[ 
https://issues.apache.org/jira/browse/PDFBOX-3523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15548023#comment-15548023
 ] 

Vasiliy Sadokhin edited comment on PDFBOX-3523 at 10/5/16 10:07 AM:
--------------------------------------------------------------------

I've attached files:
test.pdf 
OldPdfUtils.java - the code that uses PDFBox 1.8
PdfUtils.java - the code that uses PDFBox 2.0.3
old_test.png - an image of test.pdf got from OldPdfUtils
test.png - an image of test.pdf got from PdfUtils

Resolution is the same 2067 x 2923 pixels

When I say "bigger" means result file size/bytes stream. When I say "slower" it 
applies to actual "pdfRenderer.renderImageWithDPI" (new PDFBox) and 
"page.convertToImage" (old PDFBox) calls without any other operations like 
writing image via ImageIO or reading PDF file from input stream with 
PDDocument.load method.

For security reasons I had to replace initial pdf and png files I uploaded. 
There is still 3.5 times size difference between old code working with PDFBox 
1.8 and new one working with version 2.0.3.

We also tried to specify "sun.java2d.cmm" system property to 
"sun.java2d.cmm.kcms.KcmsServiceProvider" as it is suggested in migration guide 
but it didn't fix performance issue. 


was (Author: vsadokhin):
I've attached files:
test.pdf 
OldPdfUtils.java - the code that uses PDFBox 1.8
PdfUtils.java - the code that uses PDFBox 2.0.3
old_test.png - an image of test.pdf got from OldPdfUtils
test.png - an image of test.pdf got from PdfUtils

Resolution is the same 2125x2750 pixels

When I say "bigger" means result file size/bytes stream. When I say "slower" it 
applies to actual "pdfRenderer.renderImageWithDPI" (new PDFBox) and 
"page.convertToImage" (old PDFBox) calls without any other operations like 
writing image via ImageIO or reading PDF file from input stream with 
PDDocument.load method.

For security reasons I had to replace initial pdf and png files I uploaded. 
There is still 3.5 times size difference between old code working with PDFBox 
1.8 and new one working with version 2.0.3.

We also tried to specify "sun.java2d.cmm" system property to 
"sun.java2d.cmm.kcms.KcmsServiceProvider" as it is suggested in migration guide 
but it didn't fix performance issue. 

> PDFBox renders images 5 times slower and bigger
> -----------------------------------------------
>
>                 Key: PDFBOX-3523
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3523
>             Project: PDFBox
>          Issue Type: Improvement
>    Affects Versions: 2.0.3
>         Environment: Java version 1.8
> Ubuntu Linux&Windows 10
>            Reporter: Vasiliy Sadokhin
>              Labels: performance
>         Attachments: OldPdfUtils.java, PdfUtils.java, old_test.png, test.pdf, 
> test.png
>
>
> We recently migrated PDFBox from 1.8.13 to 2.0.3. We found that it becomes 5 
> times slower to get a PDF page image and the image is 5 times bigger than 
> PDFBox 1.8 did. For example, It took about 200ms and now it takes more than 1 
> second, the result size was less 200Kb and it's 1Mb now. 
> We specified BufferedImage.TYPE_3BYTE_BGR for PDFBox 1.8 and we have no way 
> to do it with 2.x. It might be a reason.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to