You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2019/02/06 16:45:00 UTC

[jira] [Resolved] (PDFBOX-4149) PDF consisting on one page with 5 MB renders until the end of time using renderImageWithDPI

     [ https://issues.apache.org/jira/browse/PDFBOX-4149?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tilman Hausherr resolved PDFBOX-4149.
-------------------------------------
       Resolution: Fixed
         Assignee: Tilman Hausherr
    Fix Version/s: 3.0.0 PDFBox
                   2.0.14

I'm setting this one as resolved. Time has gone down to 23 seconds to render at 100% on an old PC, even with 2.0.9. There were several improvements in the past, both in java and in PDFBox. Make sure to use the jdk 8 191 or higher or jdk 11.0.2 or higher. The KCMS option is no longer needed.
 
23 seconds is slow, but it's better than what was mentioned before: "until the end of time", "30 minutes", "165 seconds" or "136 seconds".
 
There's also the workaround introduced in PDFBOX-4309 ( -Dorg.apache.pdfbox.rendering.UseAlternateInsteadOfICCColorSpace=true ), that one makes it even faster but the colors won't be very good. If you want, set yourself as a watcher on that issue, other improvements were also discussed there but not made, it's a bit confusing there.

> PDF consisting on one page with 5 MB renders until the end of time using renderImageWithDPI
> -------------------------------------------------------------------------------------------
>
>                 Key: PDFBOX-4149
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4149
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Rendering
>    Affects Versions: 2.0.8
>            Reporter: Christian
>            Assignee: Tilman Hausherr
>            Priority: Major
>             Fix For: 2.0.14, 3.0.0 PDFBox
>
>         Attachments: SB_Flyer_SpargelPromo_03-062018.pdf
>
>
> I am using PDFBOX 2.0.8 on a Java VM 1.8.0_151
> The attached and valid pdf should be rendered by calling
> BufferedImage bim = pdfRenderer.renderImageWithDPI(i, 50);
> But the rendering never ends - the only thing I see is this line repeating very often in the console:
> [Finalizer] DEBUG org.apache.pdfbox.io.ScratchFileBuffer - ScratchFileBuffer not closed!
> Here is the code that is used to open the document and then start the rendering:
> {code:java}
> PDDocument document = PDDocument.load(file, MemoryUsageSetting.setupTempFileOnly());
> try  {
>    PDFRenderer pdfRenderer = new PDFRenderer(document);
>    int numberOfPages = document.getPages().getCount();
>    for (int i = 0; i < numberOfPages; i++) {
>       BufferedImage bim = pdfRenderer.renderImageWithDPI(i, 50);
> [...]
> {code}
> The line 
> BufferedImage bim = pdfRenderer.renderImageWithDPI(i, 50); 
> is never passed. I ran a test and have wait for 30 minutes to let it pass, but nothing happens. 
> Please advise what to do and how to solve the issue.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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