I want to convert multipage TIFF files, obtained from a stream, into in-memory XODs that I can also stream out. Similarly, I want to take in-memory XODs and stream them out as multipage TIFFs. I can’t use any image libraries with unusual licenses. Is there sample code for doing so?
The attached sample code shows how to do convert to and from in-memory XODs and in-memory multipage TIFFs. You can simply use the files attached to this post to replace the PDFDrawTest.java and RunTest.bat included in the draw sample of the “Java, C/C++” builds of the PDFNet SDK (downloadable from https://www.pdftron.com/pdfnet/downloads.html).
The code requires the use of Sun/Oracle’s JAI library, which is explicitly licensed to allow redistribution in commercial software.
License allowing use by commercial enterprises:
As the RunTest.bat file shows, the only required library files are jai_codec.jar, jai_core.jar, and jai_imageio.jar. Note that, as RunTest.bat shows, these jar files may need to be explicitly referenced in the classpath.
PDFDrawTest.java (4.73 KB)
RunTest.bat.txt (241 Bytes)