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 2021/04/22 18:39:00 UTC

[jira] [Commented] (PDFBOX-5174) stream / flush PDF to outputstream

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

Tilman Hausherr commented on PDFBOX-5174:
-----------------------------------------

You could try to use a scratch file with {{new PDDocument(MemoryUsageSetting.setupTempFileOnly())}}. Also make sure to reuse objects in the same PDF, i.e. create fonts and images only once.

> stream / flush PDF to outputstream
> ----------------------------------
>
>                 Key: PDFBOX-5174
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5174
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: Writing
>            Reporter: Elie Roux
>            Priority: Major
>
> My use case is that I'm building pretty large PDFs with a lot of (smallish) images and then write them to file. The only way to do so with PDFBox appears to be building the full PDF file in memory and then write it to an OutpuStream (unless there's something I didn't find?). This is possible with pdflib and iText and is a blocker for my use case, since I'm doing that on request on a web server that quickly goes out of memory with PDFBox



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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