How do I convert to/from XOD and multipage TIFF, using only in-memory streaming, on Java?


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 and RunTest.bat included in the draw sample of the “Java, C/C++” builds of the PDFNet SDK (downloadable from

The code requires the use of Sun/Oracle’s JAI library, which is explicitly licensed to allow redistribution in commercial software.

Distribution information:

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. (4.73 KB)

RunTest.bat.txt (241 Bytes)