I'm using iText to extract embedded images and save them as separate files. The .jpg and .png files come out ok, but I cannot extract tiff images that have the CCITTFaxDecode encoding.
Does anyone have a way of saving the tiff files?
I found some sample C# code that uses iTextSharp at Extracting image from PDF with /CCITTFaxDecode filter It indicates a separate tiff library is needed to write out the results. According to that article, the "CCITTFaxDecode" compression is Compression.CCITTFAX4 for the tiff library.
To use that article's method, I need: 1. get a tiff library. The Java Image I/O API will allow you to read and write TIFF files among other formats. BufferedImage image = ImageIO.read( new File( "image.tif" ) );
- Find out the equivalent of the code for getting the bitmap's property from the PDF, example: pd.Get(PdfName.WIDTH).ToString() (which is in C#)