@@ -22,13 +22,10 @@ You should have received a copy of the GNU Affero General Public License
2222*/
2323using System ;
2424using System . IO ;
25- using iText . Commons . Utils ;
2625using iText . Html2pdf . Exceptions ;
2726using iText . Kernel . Pdf ;
2827using iText . Kernel . Utils ;
2928using iText . Layout ;
30- using iText . Pdfa ;
31- using iText . Pdfa . Exceptions ;
3229using iText . Test ;
3330using iText . Test . Pdfa ;
3431
@@ -88,44 +85,6 @@ public virtual void CannotConvertHtmlToDocumentInReadingModeTest() {
8885 ) ;
8986 }
9087
91- [ NUnit . Framework . Test ]
92- public virtual void ConvertHtmlToDocumentIncorrectConverterPropertiesTest ( ) {
93- String sourceHtml = SOURCE_FOLDER + "simple.html" ;
94- String destinationPdf = DESTINATION_FOLDER + "simpleA4.pdf" ;
95- ConverterProperties converterProperties = new ConverterProperties ( ) ;
96- converterProperties . SetPdfAConformance ( PdfAConformance . PDF_A_3U ) ;
97- converterProperties . SetDocumentOutputIntent ( new PdfOutputIntent ( "Custom" , "" , "http://www.color.org" , "sRGB IEC61966-2.1"
98- , new FileStream ( SOURCE_FOLDER + "sRGB Color Space Profile.icm" , FileMode . Open , FileAccess . Read ) ) ) ;
99- PdfADocument pdfDocument = new PdfADocument ( new PdfWriter ( destinationPdf ) , PdfAConformance . PDF_A_4E , new PdfOutputIntent
100- ( "Custom" , "" , "http://www.color.org" , "sRGB IEC61966-2.1" , new FileStream ( SOURCE_FOLDER + "sRGB Color Space Profile.icm"
101- , FileMode . Open , FileAccess . Read ) ) ) ;
102- Exception e = NUnit . Framework . Assert . Catch ( typeof ( PdfAConformanceException ) , ( ) => {
103- HtmlConverter . ConvertToPdf ( sourceHtml , pdfDocument , converterProperties ) ;
104- }
105- ) ;
106- NUnit . Framework . Assert . AreEqual ( MessageFormatUtil . Format ( PdfaExceptionMessageConstant . THE_FILE_HEADER_SHALL_CONTAIN_RIGHT_PDF_VERSION
107- , "2" ) , e . Message ) ;
108- }
109-
110- [ NUnit . Framework . Test ]
111- public virtual void ConvertHtmlToDocumentWithDifferentColorProfileTest ( ) {
112- String sourceHtml = SOURCE_FOLDER + "simple.html" ;
113- String destinationPdf = DESTINATION_FOLDER + "simpleA4.pdf" ;
114- ConverterProperties converterProperties = new ConverterProperties ( ) ;
115- converterProperties . SetPdfAConformance ( PdfAConformance . PDF_A_4E ) ;
116- converterProperties . SetDocumentOutputIntent ( new PdfOutputIntent ( "Custom" , "" , "http://www.color.org" , "sRGB IEC61966-2.1"
117- , new FileStream ( SOURCE_FOLDER + "sRGB Color Space Profile.icm" , FileMode . Open , FileAccess . Read ) ) ) ;
118- PdfADocument pdfDocument = new PdfADocument ( new PdfWriter ( destinationPdf ) , PdfAConformance . PDF_A_4E , new PdfOutputIntent
119- ( "Custom" , "" , "http://www.color.org" , "sRGB IEC61966-2.1" , new FileStream ( SOURCE_FOLDER + "USWebUncoated.icc"
120- , FileMode . Open , FileAccess . Read ) ) ) ;
121- Exception e = NUnit . Framework . Assert . Catch ( typeof ( PdfAConformanceException ) , ( ) => {
122- HtmlConverter . ConvertToPdf ( sourceHtml , pdfDocument , converterProperties ) ;
123- }
124- ) ;
125- NUnit . Framework . Assert . AreEqual ( MessageFormatUtil . Format ( PdfaExceptionMessageConstant . THE_FILE_HEADER_SHALL_CONTAIN_RIGHT_PDF_VERSION
126- , "2" ) , e . Message ) ;
127- }
128-
12988 private static PdfDocument CreateTempDoc ( ) {
13089 MemoryStream outputStream = new MemoryStream ( ) ;
13190 PdfDocument pdfDocument = new PdfDocument ( new PdfWriter ( outputStream ) ) ;
0 commit comments