Am 06.04.2020 um 17:37 schrieb Esteban R:
I get an OutOfMemoryException while rendering a file with big patterns at 300
DPI:
https://gofile.io/?c=wBhyXo
(that's a demo file, made from a real life example)
java -jar pdfbox-app-2.0.19.jar PDFToImage -dpi 300 bigpatterns.pdf
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.awt.image.DataBufferInt.<init>(Unknown Source)
at java.awt.image.Raster.createPackedRaster(Unknown Source)
at
java.awt.image.DirectColorModel.createCompatibleWritableRaster(Unknown Source)
at java.awt.image.BufferedImage.<init>(Unknown Source)
at
org.apache.pdfbox.rendering.TilingPaint.getImage(TilingPaint.java:143)
,,,
Increasing memory size solves the issue, but 2,7 Gb(!) are needed and that's
not good for our environment.
I have seen a similar issue here:
https://issues.apache.org/jira/browse/PDFBOX-3653
So, I have tried setting maxedge with a smaller value:
java -Dpdfbox.rendering.tilingpaint.maxedge=500 -jar pdfbox-app-2.0.19.jar
PDFToImage -dpi 300 bigpatterns.pdf
That works better: no exception. But the generated image is wrong: a different
tiling is used.
How can I solve the issue?
You can't. Use more space, or a lower dpi.
Tilman
Esteban
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org