|
14 | 14 | import com._4point.aem.fluentforms.api.DocumentFactory; |
15 | 15 | import com._4point.aem.fluentforms.api.PathOrUrl; |
16 | 16 | import com._4point.aem.fluentforms.api.Transformable; |
| 17 | +import com._4point.aem.fluentforms.api.Xci; |
17 | 18 | import com._4point.aem.fluentforms.impl.SimpleDocumentFactoryImpl; |
18 | 19 | import com.adobe.fd.output.api.AcrobatVersion; |
19 | 20 | import com.adobe.fd.output.api.PaginationOverride; |
@@ -110,6 +111,14 @@ default GeneratePdfOutputArgumentBuilder setContentRoot(URL contentRoot) { |
110 | 111 | @Override |
111 | 112 | GeneratePdfOutputArgumentBuilder setXci(Document xci); |
112 | 113 |
|
| 114 | + @Override |
| 115 | + default GeneratePdfOutputArgumentBuilder setXci(Xci xci) { |
| 116 | + PDFOutputOptionsSetter.super.setXci(xci); |
| 117 | + return this; |
| 118 | + } |
| 119 | + |
| 120 | + public XciArgumentBuilder xci(); |
| 121 | + |
113 | 122 | public Document executeOn(PathOrUrl template, Document data) throws OutputServiceException, FileNotFoundException; |
114 | 123 |
|
115 | 124 | public Document executeOn(Path template, Document data) throws OutputServiceException, FileNotFoundException; |
@@ -185,6 +194,11 @@ default public Document executeOn(URL template) throws OutputServiceException { |
185 | 194 | default public Document executeOn(Document template) throws OutputServiceException { |
186 | 195 | return executeOn(template, (Document)null); |
187 | 196 | }; |
| 197 | + |
| 198 | + public interface XciArgumentBuilder { |
| 199 | + XciArgumentBuilder embedFonts(boolean embedFonts); |
| 200 | + GeneratePdfOutputArgumentBuilder done(); |
| 201 | + } |
188 | 202 | } |
189 | 203 |
|
190 | 204 | public static interface GeneratePrintedOutputArgumentBuilder extends PrintedOutputOptionsSetter, Transformable<GeneratePrintedOutputArgumentBuilder> { |
@@ -221,13 +235,59 @@ default GeneratePrintedOutputArgumentBuilder setContentRoot(URL url) { |
221 | 235 |
|
222 | 236 | @Override |
223 | 237 | GeneratePrintedOutputArgumentBuilder setXci(Document xci); |
| 238 | + |
| 239 | + @Override |
| 240 | + default GeneratePrintedOutputArgumentBuilder setXci(Xci xci) { |
| 241 | + PrintedOutputOptionsSetter.super.setXci(xci); |
| 242 | + return this; |
| 243 | + } |
224 | 244 |
|
| 245 | + public XciArgumentBuilder xci(); |
| 246 | + |
| 247 | + /** |
| 248 | + * Merges the provided template with the provided data and returns the generated |
| 249 | + * output. |
| 250 | + * |
| 251 | + * @param template The template to merge data into. |
| 252 | + * @param data The data to merge with the template. |
| 253 | + * @return The generated output document. |
| 254 | + * @throws OutputServiceException If an error occurs during processing. |
| 255 | + * @throws FileNotFoundException If the template file is not found. |
| 256 | + */ |
225 | 257 | public Document executeOn(PathOrUrl template, Document data) throws OutputServiceException, FileNotFoundException; |
226 | 258 |
|
| 259 | + /** |
| 260 | + * Merges the provided template with the provided data and returns the generated |
| 261 | + * output. |
| 262 | + * |
| 263 | + * @param template The template to merge data into. |
| 264 | + * @param data The data to merge with the template. |
| 265 | + * @return The generated output document. |
| 266 | + * @throws OutputServiceException If an error occurs during processing. |
| 267 | + * @throws FileNotFoundException If the template file is not found. |
| 268 | + */ |
227 | 269 | public Document executeOn(Path template, Document data) throws OutputServiceException, FileNotFoundException; |
228 | 270 |
|
| 271 | + /** |
| 272 | + * Merges the provided template with the provided data and returns the generated |
| 273 | + * output. |
| 274 | + * |
| 275 | + * @param template The template to merge data into. |
| 276 | + * @param data The data to merge with the template. |
| 277 | + * @return The generated output document. |
| 278 | + * @throws OutputServiceException If an error occurs during processing. |
| 279 | + */ |
229 | 280 | public Document executeOn(URL template, Document data) throws OutputServiceException; |
230 | 281 |
|
| 282 | + /** |
| 283 | + * Merges the provided template with the provided data and returns the generated |
| 284 | + * output. |
| 285 | + * |
| 286 | + * @param template The template to merge data into. |
| 287 | + * @param data The data to merge with the template. |
| 288 | + * @return The generated output document. |
| 289 | + * @throws FileNotFoundException If the template file is not found. |
| 290 | + */ |
231 | 291 | public Document executeOn(Document template, Document data) throws OutputServiceException; |
232 | 292 |
|
233 | 293 | default public Document executeOn(PathOrUrl template, byte[] data) throws OutputServiceException, FileNotFoundException { |
@@ -298,6 +358,11 @@ default public Document executeOn(Document template) throws OutputServiceExcepti |
298 | 358 | return executeOn(template, (Document)null); |
299 | 359 | }; |
300 | 360 |
|
| 361 | + public interface XciArgumentBuilder { |
| 362 | + XciArgumentBuilder embedPclFonts(boolean embedFonts); |
| 363 | + XciArgumentBuilder embedPsFonts(boolean embedFonts); |
| 364 | + GeneratePrintedOutputArgumentBuilder done(); |
| 365 | + } |
301 | 366 | } |
302 | 367 |
|
303 | 368 | public static interface GeneratePdfOutputBatchArgumentBuilder extends PDFOutputOptionsSetter, BatchArgumentBuilder, Transformable<GeneratePdfOutputArgumentBuilder> { |
@@ -344,7 +409,15 @@ default GeneratePdfOutputBatchArgumentBuilder setContentRoot(URL contentRoot) { |
344 | 409 | @Override |
345 | 410 | GeneratePdfOutputBatchArgumentBuilder setXci(Document xci); |
346 | 411 |
|
347 | | - // TODO: Fix up the executeOns to overload the options. |
| 412 | + @Override |
| 413 | + default GeneratePdfOutputBatchArgumentBuilder setXci(Xci xci) { |
| 414 | + PDFOutputOptionsSetter.super.setXci(xci); |
| 415 | + return this; |
| 416 | + } |
| 417 | + |
| 418 | + public XciArgumentBuilder xci(); |
| 419 | + |
| 420 | + // TODO: Fix up the executeOns to overload the options. |
348 | 421 | public BatchResult executeOn(PathOrUrl template, Document data) throws OutputServiceException, FileNotFoundException; |
349 | 422 |
|
350 | 423 | public BatchResult executeOn(Path template, Document data) throws OutputServiceException, FileNotFoundException; |
@@ -387,6 +460,10 @@ default public BatchResult executeOn(URL template) throws OutputServiceException |
387 | 460 | return executeOn(template, (Document) null); |
388 | 461 | }; |
389 | 462 |
|
| 463 | + public interface XciArgumentBuilder { |
| 464 | + XciArgumentBuilder embedFonts(boolean embedFonts); |
| 465 | + GeneratePdfOutputBatchArgumentBuilder done(); |
| 466 | + } |
390 | 467 | } |
391 | 468 |
|
392 | 469 | public static interface GeneratePrintedOutputBatchArgumentBuilder extends PrintedOutputOptionsSetter, BatchArgumentBuilder, Transformable<GeneratePrintedOutputArgumentBuilder> { |
@@ -424,7 +501,15 @@ default GeneratePrintedOutputBatchArgumentBuilder setContentRoot(URL url) { |
424 | 501 | @Override |
425 | 502 | GeneratePrintedOutputBatchArgumentBuilder setXci(Document xci); |
426 | 503 |
|
427 | | - // TODO: Fix up the executeOns to overload the options. |
| 504 | + @Override |
| 505 | + default GeneratePrintedOutputBatchArgumentBuilder setXci(Xci xci) { |
| 506 | + PrintedOutputOptionsSetter.super.setXci(xci); |
| 507 | + return this; |
| 508 | + } |
| 509 | + |
| 510 | + public XciArgumentBuilder xci(); |
| 511 | + |
| 512 | + // TODO: Fix up the executeOns to overload the options. |
428 | 513 | public BatchResult executeOn(PathOrUrl template, Document data) throws OutputServiceException, FileNotFoundException; |
429 | 514 |
|
430 | 515 | public BatchResult executeOn(Path template, Document data) throws OutputServiceException, FileNotFoundException; |
@@ -466,7 +551,12 @@ default public BatchResult executeOn(Path template) throws OutputServiceExceptio |
466 | 551 | default public BatchResult executeOn(URL template) throws OutputServiceException { |
467 | 552 | return executeOn(template, (Document)null); |
468 | 553 | }; |
469 | | - |
| 554 | + |
| 555 | + public interface XciArgumentBuilder { |
| 556 | + XciArgumentBuilder embedPclFonts(boolean embedFonts); |
| 557 | + XciArgumentBuilder embedPsFonts(boolean embedFonts); |
| 558 | + GeneratePrintedOutputBatchArgumentBuilder done(); |
| 559 | + } |
470 | 560 | } |
471 | 561 |
|
472 | 562 | public static interface BatchArgumentBuilder { |
|
0 commit comments