@@ -22,7 +22,6 @@ This file is part of the iText (R) project.
2222 */
2323package com .itextpdf .html2pdf ;
2424
25- import com .itextpdf .commons .utils .MessageFormatUtil ;
2625import com .itextpdf .html2pdf .exceptions .Html2PdfException ;
2726import com .itextpdf .kernel .pdf .PdfAConformance ;
2827import com .itextpdf .kernel .pdf .PdfDocument ;
@@ -31,9 +30,6 @@ This file is part of the iText (R) project.
3130import com .itextpdf .kernel .pdf .PdfWriter ;
3231import com .itextpdf .kernel .utils .CompareTool ;
3332import com .itextpdf .layout .Document ;
34- import com .itextpdf .pdfa .PdfADocument ;
35- import com .itextpdf .pdfa .exceptions .PdfAConformanceException ;
36- import com .itextpdf .pdfa .exceptions .PdfaExceptionMessageConstant ;
3733import com .itextpdf .test .ExtendedITextTest ;
3834import com .itextpdf .test .pdfa .VeraPdfValidator ;
3935
@@ -100,52 +96,6 @@ public void cannotConvertHtmlToDocumentInReadingModeTest() throws IOException {
10096
10197 }
10298
103- @ Test
104- public void convertHtmlToDocumentIncorrectConverterPropertiesTest () throws IOException {
105- String sourceHtml = SOURCE_FOLDER + "simple.html" ;
106- String destinationPdf = DESTINATION_FOLDER + "simpleA4.pdf" ;
107-
108- ConverterProperties converterProperties = new ConverterProperties ();
109- converterProperties .setPdfAConformance (PdfAConformance .PDF_A_3U );
110- converterProperties .setDocumentOutputIntent (new PdfOutputIntent ("Custom" , "" , "http://www.color.org" , "sRGB IEC61966-2.1" ,
111- new FileInputStream (SOURCE_FOLDER + "sRGB Color Space Profile.icm" )));
112-
113- PdfADocument pdfDocument = new PdfADocument (new PdfWriter (destinationPdf ), PdfAConformance .PDF_A_4E ,
114- new PdfOutputIntent ("Custom" , "" , "http://www.color.org" , "sRGB IEC61966-2.1" ,
115- new FileInputStream (SOURCE_FOLDER + "sRGB Color Space Profile.icm" )));
116-
117- Exception e = Assertions .assertThrows (PdfAConformanceException .class , () -> {
118- HtmlConverter .convertToPdf (sourceHtml , pdfDocument , converterProperties );
119- });
120-
121- Assertions .assertEquals (MessageFormatUtil .format (
122- PdfaExceptionMessageConstant .THE_FILE_HEADER_SHALL_CONTAIN_RIGHT_PDF_VERSION , "2" ),
123- e .getMessage ());
124- }
125-
126- @ Test
127- public void convertHtmlToDocumentWithDifferentColorProfileTest () throws IOException {
128- String sourceHtml = SOURCE_FOLDER + "simple.html" ;
129- String destinationPdf = DESTINATION_FOLDER + "simpleA4.pdf" ;
130-
131- ConverterProperties converterProperties = new ConverterProperties ();
132- converterProperties .setPdfAConformance (PdfAConformance .PDF_A_4E );
133- converterProperties .setDocumentOutputIntent (new PdfOutputIntent ("Custom" , "" , "http://www.color.org" , "sRGB IEC61966-2.1" ,
134- new FileInputStream (SOURCE_FOLDER + "sRGB Color Space Profile.icm" )));
135-
136- PdfADocument pdfDocument = new PdfADocument (new PdfWriter (destinationPdf ), PdfAConformance .PDF_A_4E ,
137- new PdfOutputIntent ("Custom" , "" , "http://www.color.org" , "sRGB IEC61966-2.1" ,
138- new FileInputStream (SOURCE_FOLDER + "USWebUncoated.icc" )));
139-
140- Exception e = Assertions .assertThrows (PdfAConformanceException .class , () -> {
141- HtmlConverter .convertToPdf (sourceHtml , pdfDocument , converterProperties );
142- });
143-
144- Assertions .assertEquals (MessageFormatUtil .format (
145- PdfaExceptionMessageConstant .THE_FILE_HEADER_SHALL_CONTAIN_RIGHT_PDF_VERSION , "2" ),
146- e .getMessage ());
147- }
148-
14999 private static PdfDocument createTempDoc () throws IOException {
150100 ByteArrayOutputStream outputStream = new ByteArrayOutputStream ();
151101 PdfDocument pdfDocument = new PdfDocument (new PdfWriter (outputStream ));
0 commit comments