Page 1 of 1

Combine Single Page PDFs into One File

Posted: 2006-03-28T20:34:05-07:00
by oddball508
I am trying to combine a large number of sets of single page PDF files into multi page PDF files.

I can create a MSAccess routine to cycle through a database, get the name of a PDF file and combine it into another PDF using ImageMagick but the resulting file has two problems.
First: The resulting file is much larger than the combine sum of its parts (36KB+38KB+73KB+80KB+62KB=8,110KB!)
Second: The original pages are of different sizes and as a result each page in the resulting file are resized to a combined maximum area on all pages. (eg If I combined two A4 pages where one is landscape and one is portraite then both pages in the final file would be 297mm x 297mm). this does not deform the picture but does leave a lot of white space to one side of the image.

Any ideas on how to do this?

Posted: 2006-03-28T21:11:30-07:00
by magick
You can create uniform page sizes with the -page option (e.g. -page 612x792). To reduce the image size, use -compress (e.g. -compress zip).

Posted: 2006-03-28T22:17:47-07:00
by oddball508
Thanks the size issue has been solved when I used...

imgobj.Convert "d:\ABC\1\1\*.pdf", "-adjoin", "d:\ABC\1\ABC-1-1-pdf.pdf"

But this still created a very large file. If I use the compress option then there is way to many artifacts in the final product.

Posted: 2006-05-25T13:01:20-07:00
by kim_earth
Can you tell me how I can run this command using Imagemagick for linux?

I also need to combine single page pdfs into a multi page pdf.

If I try *.pdf -adjoin hi.pdf


alot of whitespace and 2 tiny tiny images on seperate pages..
any other options I need?

thanks in advance..

My solution

Posted: 2006-06-17T02:06:31-07:00
by oddball508
I used PDFTK >>http://www.pdfhacks.com/pdftk/

pdftk.exe 1.pdf 2.pdf cat output 12.pdf