I was wondering if anyone has seen this problem and solved it. I am not able to 
create a PDF using a JPEG2000 image larger than about 200MB. I'm not sure that 
it really matters what type of image it is (JPG, Tiff, etc) but I happen to be 
using JPEG2000 images. This is a big problem because most of the required 
images that we work with are 1GB or greater. Currently when trying to create a 
PDF with an JPEG2000 greater than about 200MB I get an JVM OutOfMemoryError in 
32bit java version "1.6.0_25-b06" and the 32 bit version of JBOSS 5.1.0.GA on 
Windows XP Pro x64 version 2003 Service Pack 2. With JAVA_OPTS=%JAVA_OPTS% 
-Xms128m -Xmx512m -XX:MaxPermSize=256m and itextpdf-5.0.7. I've traced the code 
and the error occurs in PdfWriter.java when adding the image to the document. I 
have not tried the latest itextpdf-5.1.2 yet but I have looked at the source 
and the image creation part does not seem to have changed. I have recently 
tried 64bit Java and did not get the OutOfMemory error but I consistently get 
the Adobe Reader 9 "Insufficient data for an image" error. I've looked at the 
pdf bytes and the header, trailer, etc. seem ok. My thoughts on how to handle a 
large JEPG2000 file is simply to compose all parts of the PDF first (header, 
etc.) with a handle to where the byte stream of the image will go and when it¹s 
time to write the PDF, stream the JPEG2000 image at that time so that at no 
time will you have to keep the entire image in JVM Heap. Please let me know if 
you think this is a viable solution and or what your ideas on the subject are.



Thanks,

 

Martin

------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to