@@ -777,5 +777,38 @@ public virtual void ImageBorderRadiusTest01() {
777
777
NUnit . Framework . Assert . IsNull ( new CompareTool ( ) . CompareByContent ( outFileName , cmpFileName , destinationFolder
778
778
, "diff" ) ) ;
779
779
}
780
+
781
+ [ NUnit . Framework . Test ]
782
+ [ LogMessage ( iText . IO . LogMessageConstant . ELEMENT_DOES_NOT_FIT_AREA , Count = 3 ) ]
783
+ public virtual void CreateTiffImageTest ( ) {
784
+ String outFileName = destinationFolder + "createTiffImageTest.pdf" ;
785
+ String cmpFileName = sourceFolder + "cmp_createTiffImageTest.pdf" ;
786
+ String imgPath = sourceFolder + "group4Compression.tif" ;
787
+ PdfDocument pdfDoc = new PdfDocument ( new PdfWriter ( outFileName ) ) ;
788
+ Document document = new Document ( pdfDoc ) ;
789
+ ImageData id = ImageDataFactory . Create ( imgPath ) ;
790
+ ImageData idAsTiff = ImageDataFactory . CreateTiff ( UrlUtil . ToURL ( imgPath ) , true , 1 , true ) ;
791
+ ImageData idAsTiffFalse = ImageDataFactory . CreateTiff ( UrlUtil . ToURL ( imgPath ) , false , 1 , false ) ;
792
+ document . Add ( new iText . Layout . Element . Image ( id ) ) ;
793
+ document . Add ( new iText . Layout . Element . Image ( idAsTiff ) ) ;
794
+ document . Add ( new iText . Layout . Element . Image ( idAsTiffFalse ) ) ;
795
+ document . Close ( ) ;
796
+ NUnit . Framework . Assert . IsNull ( new CompareTool ( ) . CompareByContent ( outFileName , cmpFileName , destinationFolder
797
+ ) ) ;
798
+ }
799
+
800
+ [ NUnit . Framework . Test ]
801
+ public virtual void TiffImageWithoutCompressionTest ( ) {
802
+ String outFileName = destinationFolder + "tiffImageWithoutCompression.pdf" ;
803
+ String cmpFileName = sourceFolder + "cmp_tiffImageWithoutCompression.pdf" ;
804
+ String imgPath = sourceFolder + "no-compression-tag.tiff" ;
805
+ PdfDocument pdfDoc = new PdfDocument ( new PdfWriter ( outFileName ) ) ;
806
+ Document document = new Document ( pdfDoc ) ;
807
+ ImageData id = ImageDataFactory . Create ( imgPath ) ;
808
+ document . Add ( new iText . Layout . Element . Image ( id ) ) ;
809
+ document . Close ( ) ;
810
+ NUnit . Framework . Assert . IsNull ( new CompareTool ( ) . CompareByContent ( outFileName , cmpFileName , destinationFolder
811
+ , "diff02_" ) ) ;
812
+ }
780
813
}
781
814
}
0 commit comments