pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mihaela olteanu <mihaela...@yahoo.com>
Subject Merging a lot of small pdf documents (1/2 pages) into one pdf document
Date Mon, 03 Jun 2013 12:50:10 GMT

I have a use case where I need to merge a large number of small pdf document (hundred of thousands)
into one pdf document.
Currently I am using the method: org.apache.pdfbox.util.PDFMergerUtility.appendDocument(destination,
source); for all the source documents, not directly mergeDocuments() method in the same class
because I need to also add some bookmarks. Finally I save the document.

Is it a better way of doing this with a lower memory footprint? I tried importing each page
from the source documents by using the method PDDocument.importPage() but still throws errors
in version 1.8.2. 

When I call PDDocument.load(File) the whole document is loaded in memory? If so, it means
that saving the generated pdf after merging a subset of documents and then reloading it would
not decrease the memory use anyway ...

Could somebody point me to the right way of doing this?

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message