@@ -28,7 +28,7 @@ This file is part of the iText (R) project.
2828import com .itextpdf .html2pdf .exceptions .Html2PdfException ;
2929import com .itextpdf .html2pdf .resolver .font .DefaultFontProvider ;
3030import com .itextpdf .kernel .pdf .DocumentProperties ;
31- import com .itextpdf .kernel .pdf .PdfAConformanceLevel ;
31+ import com .itextpdf .kernel .pdf .PdfAConformance ;
3232import com .itextpdf .kernel .pdf .PdfDocument ;
3333import com .itextpdf .kernel .pdf .PdfVersion ;
3434import com .itextpdf .kernel .pdf .PdfWriter ;
@@ -62,7 +62,8 @@ This file is part of the iText (R) project.
6262 */
6363public class HtmlConverter {
6464
65- private static final List <PdfAConformanceLevel > pdf2ConformanceLevels = new ArrayList <>(Arrays . asList (PdfAConformanceLevel .PDF_A_4 , PdfAConformanceLevel .PDF_A_4E , PdfAConformanceLevel .PDF_A_4F ));
65+ private static final List <PdfAConformance > pdf2Conformances = new ArrayList <>(
66+ Arrays .asList (PdfAConformance .PDF_A_4 , PdfAConformance .PDF_A_4E , PdfAConformance .PDF_A_4F ));
6667
6768 /**
6869 * Instantiates a new HtmlConverter instance.
@@ -90,7 +91,7 @@ public static void convertToPdf(String html, OutputStream pdfStream) {
9091 * @param converterProperties a {@link ConverterProperties} instance
9192 */
9293 public static void convertToPdf (String html , OutputStream pdfStream , ConverterProperties converterProperties ) {
93- if (converterProperties != null && pdf2ConformanceLevels .contains (converterProperties .getConformanceLevel ())) {
94+ if (converterProperties != null && pdf2Conformances .contains (converterProperties .getPdfAConformance ())) {
9495 convertToPdf (html , new PdfWriter (pdfStream , new WriterProperties ().setPdfVersion (PdfVersion .PDF_2_0 )), converterProperties );
9596 return ;
9697 }
@@ -117,16 +118,16 @@ public static void convertToPdf(String html, PdfWriter pdfWriter) {
117118 * @param converterProperties a {@link ConverterProperties} instance
118119 */
119120 public static void convertToPdf (String html , PdfWriter pdfWriter , ConverterProperties converterProperties ) {
120- if (converterProperties == null || converterProperties .getConformanceLevel () == null ) {
121+ if (converterProperties == null || converterProperties .getPdfAConformance () == null ) {
121122 convertToPdf (html , new PdfDocument (pdfWriter , new DocumentProperties ()
122123 .setEventCountingMetaInfo (resolveMetaInfo (converterProperties ))), converterProperties );
123124 return ;
124125 }
125- PdfDocument document = new PdfADocument (pdfWriter , converterProperties .getConformanceLevel (),
126+ PdfDocument document = new PdfADocument (pdfWriter , converterProperties .getPdfAConformance (),
126127 converterProperties .getDocumentOutputIntent (), new DocumentProperties ()
127128 .setEventCountingMetaInfo (resolveMetaInfo (converterProperties )));
128129 converterProperties = setDefaultFontProviderForPdfA (document , converterProperties );
129- if ("A" .equals (converterProperties .getConformanceLevel ().getConformance ())) {
130+ if ("A" .equals (converterProperties .getPdfAConformance ().getLevel ())) {
130131 document .setTagged ();
131132 }
132133 convertToPdf (html , document , converterProperties );
@@ -202,7 +203,7 @@ public static void convertToPdf(InputStream htmlStream, OutputStream pdfStream)
202203 * @throws IOException Signals that an I/O exception has occurred.
203204 */
204205 public static void convertToPdf (InputStream htmlStream , OutputStream pdfStream , ConverterProperties converterProperties ) throws IOException {
205- if (converterProperties != null && pdf2ConformanceLevels .contains (converterProperties .getConformanceLevel ())) {
206+ if (converterProperties != null && pdf2Conformances .contains (converterProperties .getPdfAConformance ())) {
206207 convertToPdf (htmlStream , new PdfWriter (pdfStream , new WriterProperties ().setPdfVersion (PdfVersion .PDF_2_0 )), converterProperties );
207208 return ;
208209 }
@@ -245,16 +246,16 @@ public static void convertToPdf(InputStream htmlStream, PdfWriter pdfWriter) thr
245246 * @throws IOException Signals that an I/O exception has occurred.
246247 */
247248 public static void convertToPdf (InputStream htmlStream , PdfWriter pdfWriter , ConverterProperties converterProperties ) throws IOException {
248- if (converterProperties == null || converterProperties .getConformanceLevel () == null ) {
249+ if (converterProperties == null || converterProperties .getPdfAConformance () == null ) {
249250 convertToPdf (htmlStream , new PdfDocument (pdfWriter , new DocumentProperties ().setEventCountingMetaInfo (
250251 resolveMetaInfo (converterProperties ))), converterProperties );
251252 return ;
252253 }
253- PdfDocument document = new PdfADocument (pdfWriter , converterProperties .getConformanceLevel (),
254+ PdfDocument document = new PdfADocument (pdfWriter , converterProperties .getPdfAConformance (),
254255 converterProperties .getDocumentOutputIntent (), new DocumentProperties ()
255256 .setEventCountingMetaInfo (resolveMetaInfo (converterProperties )));
256257 converterProperties = setDefaultFontProviderForPdfA (document , converterProperties );
257- if ("A" .equals (converterProperties .getConformanceLevel ().getConformance ())) {
258+ if ("A" .equals (converterProperties .getPdfAConformance ().getLevel ())) {
258259 document .setTagged ();
259260 }
260261 convertToPdf (htmlStream , document , converterProperties );
@@ -446,7 +447,7 @@ private static ConverterProperties setDefaultFontProviderForPdfA(PdfDocument doc
446447 if (properties .getFontProvider () == null ) {
447448 properties .setFontProvider (new DefaultFontProvider (false , true , false ));
448449 }
449- } else if (document == null && properties != null && properties .getConformanceLevel () != null ) {
450+ } else if (document == null && properties != null && properties .getPdfAConformance () != null ) {
450451 if (properties .getFontProvider () == null ) {
451452 properties .setFontProvider (new DefaultFontProvider (false , true , false ));
452453 }
0 commit comments