[
https://issues.apache.org/jira/browse/PDFBOX-6003?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17949709#comment-17949709
]
Tilman Hausherr edited comment on PDFBOX-6003 at 5/6/25 1:34 PM:
-----------------------------------------------------------------
Yes + Yes you can use that too. I mentioned the full temp method so that you
can see whether it works at all. I can't remember whether this works in the
latest 3.0 or only in the unreleased 4.0.
was (Author: tilman):
Yes you can use that too. I mentioned the full temp method so that you can see
whether it works at all. I can't remember whether this works in the latest 3.0
or only in the unreleased 4.0.
> Render image with DPI memory optimisation
> -----------------------------------------
>
> Key: PDFBOX-6003
> URL: https://issues.apache.org/jira/browse/PDFBOX-6003
> Project: PDFBox
> Issue Type: Wish
> Components: Rendering
> Affects Versions: 3.0.5 PDFBox
> Reporter: Michael
> Priority: Critical
> Attachments: image-2025-05-06-13-21-19-246.png,
> image-2025-05-06-13-21-19-281.png, image-2025-05-06-13-21-19-327.png
>
>
> In our PDF processing flow, where a customer could upload multi-page PDFs in
> different versions and resolutions, we encountered an OutOfMemory problem.
> The issue was, that the size of one of the images of a signature in a PDF
> page was 38884 to 30200. As a result, "SampledImageReader.getStencilImage"
> was trying to allocate *~4.5GB* of memory to convert a *1.7MB* single page
> PDF to an image.
> The initial page size from the PDFBox was 446 to 631 (points), the DPI for
> the image conversion was 200.
> Is there any reason for allocating the image buffer similar to the original
> image in the PDF?
> Wouldn't it be sufficient to follow the page size proportion and required
> DPI, and allocate an image buffer size accordingly?
>
> !image-2025-05-06-13-21-19-246.png|width=1050,height=459!!image-2025-05-06-13-21-19-281.png|width=1002,height=570!!image-2025-05-06-13-21-19-327.png|width=994,height=593!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]