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

Petr Slaby commented on PDFBOX-2092:
------------------------------------

[~jahewson]: I think the time spent in PageDrawer.drawImage is due to the image 
being created with BandedColorRaster and ComponentColorModel in the classes 
SampledImageReader and PDDeviceRGB. When rendering the bitmap on the target 
buffered image, AWT converts the source first. From the stack trace I get in 
profiler, it even seems that they create a new temporary buffered image for the 
conversion, doubling the memory consumption. This might also partially explain 
the out of memory problems reported in PDFBOX-2101. To test this, I have 
changed SampledImageReader and PDDeviceRGB to produce a packed raster with 
DirectColorModel. PageDrawer.drawImage completely vanished from the profiler 
output then. 

> Very slow rendering of scanned document
> ---------------------------------------
>
>                 Key: PDFBOX-2092
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2092
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: Rendering
>    Affects Versions: 2.0.0
>         Environment: Win7 x64 EN
> JDK6,JDK7,JDK8
>            Reporter: Juraj Lonc
>         Attachments: SCAN_20140522_160457490_page2.pdf
>
>
> It takes extremely long to render this file to image.
> Depends on computer but it can take 15s+ to render 1 page.
> When I skip drawing of inserted image /Im0, then rendering is fast. So there 
> is something wrong with drawing that image in
> {code}
> PageDrawer.drawImage(Image awtImage, AffineTransform at)
> {code}
> when I comment out line 
> {code}
> graphics.drawImage(awtImage, imageTransform, null);
> {code}
> then rendering process takes 6s



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to