Out of Memory error
Hi, I am trying to generate PDF from 45MB .fo file, fop produces a pdf of about 12MB and it fails with out of memory errors. XMx and XMs options are set for 2048MB(that's max I could go on the machine). And this .fo file is referring to about 300 images of appx 48KB each. FOP should be able to generate PDF. I am not sure if images are causing this issue. Does anyone know if images are the issue? Here is the error: Exception in thread main java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Unknown Source) at java.io.ByteArrayOutputStream.write(Unknown Source) at java.io.OutputStream.write(Unknown Source) at org.apache.fop.pdf.PDFStream.add(PDFStream.java:60) at org.apache.fop.render.pdf.PDFRenderer.concatenateTransformationMatrix (PDFRenderer.java:839) at org.apache.fop.render.AbstractPathOrientedRenderer.renderReferenceAre a(AbstractPathOrientedRenderer.java:539) at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.j ava:560) at org.apache.fop.render.pdf.PDFRenderer.renderBlock(PDFRenderer.java:13 29) at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer. java:526) at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.j ava:573) at org.apache.fop.render.pdf.PDFRenderer.renderBlock(PDFRenderer.java:13 29) at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer. java:526) Thanks, Vsyamala -- View this message in context: http://www.nabble.com/Out-of-Memory-error-tp20962360p20962360.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
help!!
Hi All: Is there any way to generate the XSL file out of PDF? Pls help me!! Thanks Regards, Senthil
AW: help!!
No. HTH. Georg Datterl -- Kontakt -- Georg Datterl Geneon media solutions gmbh Gutenstetter Straße 8a 90449 Nürnberg HRB Nürnberg: 17193 Geschäftsführer: Yong-Harry Steiert Tel.: 0911/36 78 88 - 26 Fax: 0911/36 78 88 - 20 www.geneon.de Weitere Mitglieder der Willmy MediaGroup: IRS Integrated Realization Services GmbH:www.irs-nbg.de Willmy PrintMedia GmbH:www.willmy.de Willmy Consult Content GmbH: www.willmycc.de -Ursprüngliche Nachricht- Von: Selvam, Senthil [mailto:senthil_sel...@intuit.com] Gesendet: Donnerstag, 11. Dezember 2008 20:13 An: fop-users@xmlgraphics.apache.org Betreff: help!! Hi All: Is there any way to generate the XSL file out of PDF? Pls help me!! Thanks Regards, Senthil - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: Out of Memory error
Vsyamala, There are a variety of factors that could contribute to your OOM error, including, most significantly, the size of your page sequences within you FO, the types of images that you're embedding, the version of FOP that you're using, and whether you're writing to the PDF in memory or into a file. 300 images @ 48KB each doesn't sound extreme, but a 45MB FO file is pretty big. It's too hard to say whether a 45MB FO file with 300 images at 48KB each should be able to run in 2GB memory...there's just too many variables that aren't mentioned. So I would recommend a divide-and-conquer approach. Remove the image references from the FO and try again. Still run out of memory or come close to it? If so, it must not be the images. Different versions of FOP handle images in different ways. For example, in v0.20.5 (maybe 0.95 as well), JPG images were directly embedded into the PDF whereas PNG images were transcoded into bitmaps and compressed into the PDF. As a consequence, JPG images used a lot less processor power but created, generally, larger PDFs. I just noticed from your stack trace that it appears you're writing to a ByteArrayOutputStream. That could be a big problem right there. You're wanting to store the entire 12+MB PDF in memory in addition to the memory needed for FOP to function? A much better option would be to write that file to disk. Likewise, are you feeding the FO into FOP from a memory stream, a file stream, or as the result of an XML/XSLT transformation? Of all options, if you're rendering files this big, you should use the FileInputStream method. Sean -Original Message- From: vsyamala [mailto:vsyam...@gmail.com] Sent: Thursday, December 11, 2008 1:10 PM To: fop-users@xmlgraphics.apache.org Subject: Out of Memory error Hi, I am trying to generate PDF from 45MB .fo file, fop produces a pdf of about 12MB and it fails with out of memory errors. XMx and XMs options are set for 2048MB(that's max I could go on the machine). And this .fo file is referring to about 300 images of appx 48KB each. FOP should be able to generate PDF. I am not sure if images are causing this issue. Does anyone know if images are the issue? Here is the error: Exception in thread main java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Unknown Source) at java.io.ByteArrayOutputStream.write(Unknown Source) at java.io.OutputStream.write(Unknown Source) at org.apache.fop.pdf.PDFStream.add(PDFStream.java:60) at org.apache.fop.render.pdf.PDFRenderer.concatenateTransformationMatrix (PDFRenderer.java:839) at org.apache.fop.render.AbstractPathOrientedRenderer.renderReferenceAre a(AbstractPathOrientedRenderer.java:539) at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.j ava:560) at org.apache.fop.render.pdf.PDFRenderer.renderBlock(PDFRenderer.java:13 29) at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer. java:526) at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.j ava:573) at org.apache.fop.render.pdf.PDFRenderer.renderBlock(PDFRenderer.java:13 29) at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer. java:526) Thanks, Vsyamala -- View this message in context: http://www.nabble.com/Out-of-Memory-error-tp20962360p20962360.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org -- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: PDF Image extension and encryption don't go together?
Jeremias Maerki d...@jeremias-maerki.ch wrote: It appears this is not so simple. Depending on which approach I try I end up missing functionality in either the PDFBox or FOP PDF library APIs to cover that requirement: If I work with the decoded stream but get a PDF with JPEG images I get a warning from PDFBox: Warning: DCTFilter.decode is not implemented yet, skipping this stream. And the resulting PDF is corrupt. I would need the ability to ignore the DCT filter which is currently not possible. On the other side, if I want to try to just encrypt the undecoded stream AbstractPDFStream currently lacks finer control over the applied filters. So I either have to modify PDFBox or the FOP PDF library for which I don't currently have enough time. It also creates a dependency on a new version of either package. So for now, that means: no support for encrypting PDFs when PDF images are used. If you want to try yourself, feel free. Sorry if this is a little bit of a shameless plug, but Linux users would most likely be able to use my qpdf software, http://qpdf.sourceforge.net/, which can encrypt arbitrary PDF files. The licensing terms are relatively unrestrictive (Artistic license), so if there's any logic there that you could steal, have at it. It's C++ code, so it would have to be translated, of course. To use it outright, one could generate a non-encrypted PDF with fop and then encrypt it with qpdf. qpdf can also linearize and do other transformations on the file. I haven't tried this on a PDF file that fop is encrypting incorrectly, but I would be willing to try it. I don't have a windows version of qpdf at this time. -- Jay Berkenbilt - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org