@@ -22,7 +22,6 @@ This file is part of the iText (R) project.
22
22
*/
23
23
package com .itextpdf .html2pdf ;
24
24
25
- import com .itextpdf .commons .utils .MessageFormatUtil ;
26
25
import com .itextpdf .html2pdf .exceptions .Html2PdfException ;
27
26
import com .itextpdf .kernel .pdf .PdfAConformance ;
28
27
import com .itextpdf .kernel .pdf .PdfDocument ;
@@ -31,9 +30,6 @@ This file is part of the iText (R) project.
31
30
import com .itextpdf .kernel .pdf .PdfWriter ;
32
31
import com .itextpdf .kernel .utils .CompareTool ;
33
32
import com .itextpdf .layout .Document ;
34
- import com .itextpdf .pdfa .PdfADocument ;
35
- import com .itextpdf .pdfa .exceptions .PdfAConformanceException ;
36
- import com .itextpdf .pdfa .exceptions .PdfaExceptionMessageConstant ;
37
33
import com .itextpdf .test .ExtendedITextTest ;
38
34
import com .itextpdf .test .pdfa .VeraPdfValidator ;
39
35
@@ -100,52 +96,6 @@ public void cannotConvertHtmlToDocumentInReadingModeTest() throws IOException {
100
96
101
97
}
102
98
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
-
149
99
private static PdfDocument createTempDoc () throws IOException {
150
100
ByteArrayOutputStream outputStream = new ByteArrayOutputStream ();
151
101
PdfDocument pdfDocument = new PdfDocument (new PdfWriter (outputStream ));
0 commit comments