Quantcast

Geospatial PDF Creation Problem with Large JPEG2000 image

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Geospatial PDF Creation Problem with Large JPEG2000 image

mschwartzman
I am not able to create a Geospatial PDF using a JPEG2000 image larger than about 200MB. 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 GeoPDF with an JPX greater than about 200MB I get an JVM OutOfMemoryError in 32bit java version "1.6.0_20" 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 a modified version of the itextpdf-5.0.7 Java PDF library. I have not tried the latest itextpdf-5.1.1 yet but I have looked at the source and the image creation part does not seem to have changed. Yes, I will try 64bit Java as soon as I can. However, many of our customers are still using the 32bit version so upgrading all of them might be painful. 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 JPX 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

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Geospatial PDF Creation Problem with Large JPEG2000 image

Leonard Rosenthol-3
Martin - are your JPEG2000 files in .jpx or .jp2 format?  Do you know
whether they use any of the non-baseline functionality?

The issue is that PDF supports a very specific "profile" of JPEG2000 and
so it may not be possible to just "stream it out"...

Leonard

On 8/2/11 2:51 PM, "mschwartzman" <[hidden email]> wrote:

>I am not able to create a Geospatial PDF using a JPEG2000 image larger
>than
>about 200MB. 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 GeoPDF
>with an JPX greater than about 200MB I get an JVM OutOfMemoryError in
>32bit
>java version "1.6.0_20" 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 a modified version of the itextpdf-5.0.7
>Java PDF library. I have not tried the latest itextpdf-5.1.1 yet but I
>have
>looked at the source and the image creation part does not seem to have
>changed. Yes, I will try 64bit Java as soon as I can. However, many of our
>customers are still using the 32bit version so upgrading all of them might
>be painful. 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 JPX 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
>
>
>
>--
>View this message in context:
>http://itext-general.2136553.n4.nabble.com/Geospatial-PDF-Creation-Problem
>-with-Large-JPEG2000-image-tp3713876p3713876.html
>Sent from the iText - General mailing list archive at Nabble.com.
>
>--------------------------------------------------------------------------
>----
>BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
>The must-attend event for mobile developers. Connect with experts.
>Get tools for creating Super Apps. See the latest technologies.
>Sessions, hands-on labs, demos & much more. Register early & save!
>http://p.sf.net/sfu/rim-blackberry-1
>_______________________________________________
>iText-questions mailing list
>[hidden email]
>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


------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts.
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
iText-questions mailing list
[hidden email]
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 | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

RE: Geospatial PDF Creation Problem with Large JPEG2000 image

mschwartzman

I have been testing with .jp2 EPJE profile files. They don’t fail in the JPEG2000.java class. The ones under 200MB work. Any greater generate a JVM OutOfMemoryError. I’ve traced the code and the error occurs in PdfWriter.java when adding the image to the document. I can run a test and get the exact line if you think it will help.

 

Thanks,

 

Martin

 

From: Leonard Rosenthol-3 [via iText - General] [mailto:[hidden email]]
Sent: Tuesday, August 02, 2011 5:11 PM
To: Martin Schwartzman
Subject: Re: Geospatial PDF Creation Problem with Large JPEG2000 image

 

Martin - are your JPEG2000 files in .jpx or .jp2 format?  Do you know
whether they use any of the non-baseline functionality?

The issue is that PDF supports a very specific "profile" of JPEG2000 and
so it may not be possible to just "stream it out"...

Leonard

On 8/2/11 2:51 PM, "mschwartzman" <[hidden email]> wrote:


>I am not able to create a Geospatial PDF using a JPEG2000 image larger
>than
>about 200MB. 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 GeoPDF
>with an JPX greater than about 200MB I get an JVM OutOfMemoryError in
>32bit
>java version "1.6.0_20" 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 a modified version of the itextpdf-5.0.7
>Java PDF library. I have not tried the latest itextpdf-5.1.1 yet but I
>have
>looked at the source and the image creation part does not seem to have
>changed. Yes, I will try 64bit Java as soon as I can. However, many of our
>customers are still using the 32bit version so upgrading all of them might
>be painful. 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 JPX 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
>
>
>
>--
>View this message in context:
>click here.

Loading...