@@ -28,7 +28,9 @@ This file is part of the iText (R) project.
28
28
import com .itextpdf .html2pdf .attach .util .AlternateDescriptionResolver ;
29
29
import com .itextpdf .html2pdf .css .apply .ICssApplierFactory ;
30
30
import com .itextpdf .kernel .pdf .PdfAConformance ;
31
+ import com .itextpdf .kernel .pdf .PdfConformance ;
31
32
import com .itextpdf .kernel .pdf .PdfOutputIntent ;
33
+ import com .itextpdf .kernel .pdf .PdfUAConformance ;
32
34
import com .itextpdf .layout .font .FontProvider ;
33
35
import com .itextpdf .styledxmlparser .css .media .MediaDeviceDescription ;
34
36
import com .itextpdf .styledxmlparser .resolver .resource .IResourceRetriever ;
@@ -122,7 +124,7 @@ public class ConverterProperties {
122
124
/**
123
125
* Conformance for conversion to pdf/a.
124
126
*/
125
- private PdfAConformance aConformance ;
127
+ private PdfConformance conformance = new PdfConformance () ;
126
128
127
129
/**
128
130
* Instantiates a new {@link ConverterProperties} instance.
@@ -151,7 +153,8 @@ public ConverterProperties(ConverterProperties other) {
151
153
this .limitOfLayouts = other .limitOfLayouts ;
152
154
this .immediateFlush = other .immediateFlush ;
153
155
this .continuousContainerEnabled = other .continuousContainerEnabled ;
154
-
156
+ this .conformance = other .conformance ;
157
+ this .outputIntent = other .outputIntent ;
155
158
for (Class <?> aClass : other .dependencies .keySet ()) {
156
159
this .dependencies .put (aClass , other .dependencies .get (aClass ));
157
160
}
@@ -354,7 +357,6 @@ public boolean isCreateAcroForm() {
354
357
* When enabling this acroform creation, it will disable the immediateFlushing property.
355
358
*
356
359
* @param createAcroForm true if an AcroForm needs to be created
357
- *
358
360
* @return the {@link ConverterProperties} instance
359
361
*/
360
362
public ConverterProperties setCreateAcroForm (boolean createAcroForm ) {
@@ -420,16 +422,28 @@ public ConverterProperties setCharset(String charset) {
420
422
return this ;
421
423
}
422
424
425
+ /**
426
+ * Gets pdf document output intent (final destination device) to reproduce the color in the PDF.
427
+ *
428
+ * <p>
429
+ * Note, output intent isn't applicable for HtmlConverter#convertToElements methods
430
+ * (e.g. {@link HtmlConverter#convertToElements(InputStream, ConverterProperties)})
431
+ *
432
+ * @return pdf output intent
433
+ */
434
+ public PdfOutputIntent getDocumentOutputIntent () {
435
+ return outputIntent ;
436
+ }
437
+
423
438
/**
424
439
* Sets pdf document output intent (final destination device) to reproduce the color in the PDF.
425
- * Required parameter, when converting to pdf/a one have to specify an explicit output intent.
440
+ * Required parameter, when converting to pdf/a one has to specify an explicit output intent.
426
441
*
427
442
* <p>
428
443
* Note, output intent isn't applicable for HtmlConverter#convertToElements methods
429
444
* (e.g. {@link HtmlConverter#convertToElements(InputStream, ConverterProperties)})
430
445
*
431
446
* @param outputIntent a {@link PdfOutputIntent} instance
432
- *
433
447
* @return the {@link ConverterProperties} instance
434
448
*/
435
449
public ConverterProperties setDocumentOutputIntent (PdfOutputIntent outputIntent ) {
@@ -438,38 +452,45 @@ public ConverterProperties setDocumentOutputIntent(PdfOutputIntent outputIntent)
438
452
}
439
453
440
454
/**
441
- * Sets the generation and strictness level of the PDF/A that must be followed.
442
- * Required parameter, when converting to pdf/a one have to specify an explicit pdf/a conformance.
455
+ * Gets the generation and strictness level of the PDF/A that must be followed.
443
456
*
444
- * @param conformance a {@link PdfAConformance} constant
457
+ * @return pdf/a conformance
458
+ */
459
+ public PdfAConformance getPdfAConformance () {
460
+ return conformance .getAConformance ();
461
+ }
462
+
463
+ /**
464
+ * Sets the generation and strictness level of the PDF/A that must be followed.
465
+ * Required parameter, when converting to pdf/a one has to specify an explicit pdf/a conformance.
445
466
*
467
+ * @param aConformance a {@link PdfAConformance} constant
446
468
* @return the {@link ConverterProperties} instance
447
469
*/
448
- public ConverterProperties setPdfAConformance (PdfAConformance conformance ) {
449
- this .aConformance = conformance ;
470
+ public ConverterProperties setPdfAConformance (PdfAConformance aConformance ) {
471
+ this .conformance = new PdfConformance ( aConformance , conformance . getUAConformance ()) ;
450
472
return this ;
451
473
}
452
474
453
475
/**
454
- * Gets pdf document output intent (final destination device) to reproduce the color in the PDF .
476
+ * Gets the generation and strictness level of the PDF/UA that must be followed .
455
477
*
456
- * <p>
457
- * Note, output intent isn't applicable for HtmlConverter#convertToElements methods
458
- * (e.g. {@link HtmlConverter#convertToElements(InputStream, ConverterProperties)})
459
- *
460
- * @return pdf output intent
478
+ * @return The PDF/UA conformance level.
461
479
*/
462
- public PdfOutputIntent getDocumentOutputIntent () {
463
- return outputIntent ;
480
+ public PdfUAConformance getPdfUaConformance () {
481
+ return conformance . getUAConformance () ;
464
482
}
465
483
466
484
/**
467
- * Gets the generation and strictness level of the PDF/A that must be followed.
485
+ * Sets the generation and strictness level of the PDF/UA that must be followed.
486
+ * Required parameter, when converting to PDF/UA one has to specify an explicit PDF/UA conformance.
468
487
*
469
- * @return pdf/a conformance
488
+ * @param uaConformance a {@link PdfUAConformance} constant
489
+ * @return the {@link ConverterProperties} instance
470
490
*/
471
- public PdfAConformance getPdfAConformance () {
472
- return aConformance ;
491
+ public ConverterProperties setPdfUAConformance (PdfUAConformance uaConformance ) {
492
+ this .conformance = new PdfConformance (conformance .getAConformance (), uaConformance );
493
+ return this ;
473
494
}
474
495
475
496
/**
0 commit comments