Hi,
Try using "MemoryUsageSetting.setupTempFileOnly()" as 2nd parameter when loading your document. And you can slightly lessen the memory footprint by not using "data". Just pass a FileInputStream to PDEmbeddedFile(). This is poorly documented / there is a javadoc bug - the input stream is closed.
Tilman
PS: I wrote a comment in your SO question.

Am 01.01.2020 um 10:54 schrieb Dhaval Vekaria:
Hi,

I am using pdfbox library version 2.0.17 and attaching/embedding files to pdf. 
The problem is while attaching large files, it give java heap space issue.

Attache files(i. e. docs) size are 300mb, 400mb and 500mb.

Sample code link: 
https://drive.google.com/open?id=1fOJHvZN_9M8CnS-0aQOtFxQ5Xzg2DMng

Note: Above static class able to generate the PDF with attachments but same 
code is not working in web application.

Web Application running with 2GB heap space parameter.

Could some one help me out for the issue.

Regards,
Dhaval



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

Reply via email to