You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Daniel Franklin <da...@ryerson.ca> on 2013/07/02 22:24:39 UTC

pretty merge for pdfs

Hi there, I'm using your PDFMergerUtility to merge a number of pdf
documents that I have. But I wanted to know if there's any way to work
around doing a page merge in favour of doing a content merge.

Lets say I have two pdf documents both with five lines, and I merge them,
I'll get a two page pdf document where both have five lines and alot of
white space. Is there any way to implement a pretty merge? This will see
how many remaining lines of white space are left on the page and compare it
with the number of lines on the to be added page and if it fits add it to
the page and not just append a new page?

I have 200 pdf files that would if I hand crafted the merged pdf file
result in about 60 or so pages.

Thank you, Daniel.

Re: pretty merge for pdfs

Posted by Maruan Sahyoun <sa...@fileaffairs.de>.
Hi Daniel,

if you know the boundaries of the objects you can import the pages, crop them, and overlay on a new blank page. Take a look at Overlay2 command line tool to see how this can be done.

Maruan Sahyoun