pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: Cannot Render Pdf
Date Thu, 10 May 2018 16:20:52 GMT
300dpi is of course much slower. I ran it with -Xmx16g and it took 703 
seconds to render at 288dpi.

Sadly there is no solution except rendering at a lower dpi. Your PDF is 
huge, it is 3600 x 7036 units, so this is 1270 x 2489mm, which is larger 
than DIN A0 !

Tilman



Am 10.05.2018 um 16:59 schrieb Luca Loiodice:
> Tilman,
>
>
> When I specified 8GB of memory, it eventually ended in 968 seconds (16
> minutes)
> I am trying to run this in AWS lambda where I have a 5 minutes limit.
> Any suggestions to speed it up?
> Even if I had to scale the page with large images before rendering ... or
> any other trick.
>
>
> Environment info:
>
>
> java -version
>
> java version "1.8.0_141"
>
> Java(TM) SE Runtime Environment (build 1.8.0_141-b15)
>
> Java HotSpot(TM) 64-Bit Server VM (build 25.141-b15, mixed mode)
>
>
> uname -a
>
> Darwin Lucas-MacBook-Pro.local 16.7.0 Darwin Kernel Version 16.7.0: Thu Jan
> 11 22:59:40 PST 2018; root:xnu-3789.73.8~1/RELEASE_X86_64 x86_64
>
>
> sysctl -n machdep.cpu.brand_string
>
> Intel(R) Core(TM) i7-6920HQ CPU @ 2.90GHz
>
> CODE:
>
> System.out.println("At " + DateTime.now() + " started");
>
> System.setProperty("sun.java2d.cmm", "sun.java2d.cmm.kcms.KcmsServiceProvider");
> System.setProperty("org.apache.pdfbox.rendering.UsePureJavaCMYKConversion",
> "true");
>
> File file = new File("/tmp/Productions_14_37547.pdf");
>
> PDDocument pdDocument = PDDocument.load(file);
> PDFRenderer pdfRenderer = new PDFRenderer(pdDocument);
> pdfRenderer.setSubsamplingAllowed(true);
>
> long startTime = System.currentTimeMillis();
>
> BufferedImage image = pdfRenderer.renderImageWithDPI(0, (float)300,
> ImageType.BINARY);
>
> long elapsed = System.currentTimeMillis() - startTime;
>
> System.out.println("At " + DateTime.now() + " completed in "+ elapsed
> + " (ms)");
>
> return elapsed;
>
>
> On Wed, May 9, 2018 at 4:59 PM, Tilman Hausherr <THausherr@t-online.de>
> wrote:
>
>> I'm able to render your file with PDFDebugger and had -Xmx4g, and it takes
>> 30 seconds on a fast computer. Did you use that KCMS option? What jdk are
>> you using?
>>
>> Tilman
>>
>>
>> Am 09.05.2018 um 23:24 schrieb Luca Loiodice:
>>
>>> Hello,
>>>
>>> I have some files that I cannot render using version 2.0.9.
>>>
>>> Also tried adding following:
>>>
>>> System.setProperty("org.apache.pdfbox.rendering.UsePureJavaC
>>> MYKConversion",
>>> "true");
>>>
>>> and
>>>
>>> pdfRenderer.setSubsamplingAllowed(true);
>>>
>>>
>>> This is an example:
>>> https://www.dropbox.com/s/4i0gf0895viwk93/my_inputfile_test.2.pdf?dl=0
>>>
>>> with 4GB (-Xmx4000m) after 9 minutes:
>>>
>>> 2018-05-09 16:19:45.852 java[5821:73510387] IMKClient Stall detected,
>>> *please Report* your user scenario attaching a spindump (or sysdiagnose)
>>> that captures the problem -
>>> (imkxpc_presentFunctionRowItemTextInputViewWithEndpoint:reply:) block
>>> performed very slowly (2.27 secs).
>>>
>>> with less memory
>>>
>>> Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit
>>> exceeded
>>> at java.lang.Integer.valueOf(Integer.java:832)
>>> at
>>> org.apache.pdfbox.pdmodel.graphics.shading.TriangleBasedShad
>>> ingContext.calcPixelTable(TriangleBasedShadingContext.java:121)
>>> at
>>> org.apache.pdfbox.pdmodel.graphics.shading.PatchMeshesShadin
>>> gContext.calcPixelTable(PatchMeshesShadingContext.java:280)
>>> at
>>> org.apache.pdfbox.pdmodel.graphics.shading.TriangleBasedShad
>>> ingContext.createPixelTable(TriangleBasedShadingContext.java:80)
>>> at
>>> org.apache.pdfbox.pdmodel.graphics.shading.PatchMeshesShadin
>>> gContext.<init>(PatchMeshesShadingContext.java:71)
>>> at
>>> org.apache.pdfbox.pdmodel.graphics.shading.Type7ShadingConte
>>> xt.<init>(Type7ShadingContext.java:46)
>>> at
>>> org.apache.pdfbox.pdmodel.graphics.shading.Type7ShadingPaint
>>> .createContext(Type7ShadingPaint.java:68)
>>> at sun.java2d.pipe.AlphaPaintPipe.startSequence(AlphaPaintPipe.java:84)
>>> at sun.java2d.pipe.AAShapePipe.renderTiles(AAShapePipe.java:168)
>>> at sun.java2d.pipe.AAShapePipe.renderPath(AAShapePipe.java:159)
>>> at sun.java2d.pipe.AAShapePipe.fill(AAShapePipe.java:68)
>>> at
>>> sun.java2d.pipe.PixelToParallelogramConverter.fill(PixelToPa
>>> rallelogramConverter.java:164)
>>> at sun.java2d.pipe.ValidatePipe.fill(ValidatePipe.java:160)
>>> at sun.java2d.SunGraphics2D.fill(SunGraphics2D.java:2527)
>>> at org.apache.pdfbox.rendering.PageDrawer.shadingFill(PageDrawe
>>> r.java:1236)
>>> at
>>> org.apache.pdfbox.contentstream.operator.graphics.
>>> ShadingFill.process(ShadingFill.java:41)
>>> at
>>> org.apache.pdfbox.contentstream.PDFStreamEngine.processOpera
>>> tor(PDFStreamEngine.java:848)
>>> at
>>> org.apache.pdfbox.contentstream.PDFStreamEngine.processStrea
>>> mOperators(PDFStreamEngine.java:503)
>>> at
>>> org.apache.pdfbox.contentstream.PDFStreamEngine.processStrea
>>> m(PDFStreamEngine.java:477)
>>> at
>>> org.apache.pdfbox.contentstream.PDFStreamEngine.showForm(
>>> PDFStreamEngine.java:181)
>>> at
>>> org.apache.pdfbox.contentstream.operator.graphics.
>>> DrawObject.process(DrawObject.java:70)
>>> at
>>> org.apache.pdfbox.contentstream.PDFStreamEngine.processOpera
>>> tor(PDFStreamEngine.java:848)
>>> at
>>> org.apache.pdfbox.contentstream.PDFStreamEngine.processStrea
>>> mOperators(PDFStreamEngine.java:503)
>>> at
>>> org.apache.pdfbox.contentstream.PDFStreamEngine.processStrea
>>> m(PDFStreamEngine.java:477)
>>> at
>>> org.apache.pdfbox.contentstream.PDFStreamEngine.showForm(
>>> PDFStreamEngine.java:181)
>>> at
>>> org.apache.pdfbox.contentstream.operator.graphics.
>>> DrawObject.process(DrawObject.java:70)
>>> at
>>> org.apache.pdfbox.contentstream.PDFStreamEngine.processOpera
>>> tor(PDFStreamEngine.java:848)
>>> at
>>> org.apache.pdfbox.contentstream.PDFStreamEngine.processStrea
>>> mOperators(PDFStreamEngine.java:503)
>>> at
>>> org.apache.pdfbox.contentstream.PDFStreamEngine.processStrea
>>> m(PDFStreamEngine.java:477)
>>> at
>>> org.apache.pdfbox.contentstream.PDFStreamEngine.showForm(
>>> PDFStreamEngine.java:181)
>>> at
>>> org.apache.pdfbox.contentstream.operator.graphics.
>>> DrawObject.process(DrawObject.java:70)
>>> at
>>> org.apache.pdfbox.contentstream.PDFStreamEngine.processOpera
>>> tor(PDFStreamEngine.java:848)
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message