views:

1578

answers:

7

I have several A4 PDF documents which I would like (two into one) "glue" together into A3 format PDF document. So I will get from 2PDFs A4 a single one sided PDF A3. I have found the excellent utility PDFToolkit and some others but none of them can be used to "glue" side by side two documents.

+1  A: 

On the Postscript side, a tool named pstops is able to rearrange pages of a Postscript file in any way you could imagine. I've not heard of such a tool for PDF. But pdf2ps and ps2pdf exist. So a not-so-ideal solution may be a combination of pdf2ps, pstops and ps2pdf.

mouviciel
After going crazy with NoClassDefFoundError messages, it turns out that the only working JAR I could find was http://www.vrspace.org/sdk/java/multivalent/Multivalent20060102.jar
l0b0
+1  A: 

I would combine the two A4 pages into one 2-page PDF using pdftk. Then Print to PDF using something like PrimoPDF, and tell it to print to A3 format, two pages per side.

I just tested this printing some slides from PowerPoint. It worked great. I selected A3 as my paper size in PowerPoint, and then chose to print 2 pages per side. Printed to Primo and voila, I have two A4 slides per A3.

Nathan DeWitt
I also thought about such solution, will test if the quality is good enought for comercial magazine print.
Drejc
The only problem that comes with this solution is a black line between the two joined sheets. Is there a way to remove this later on?
Drejc
You can get rid of the lines by using adobe reader to print, setting 2 pages per sheet in adobe reader print settings, and setting page size to A3 in the PDF printer settings.
danio
Found a better solution If you look at my answer, which is the perfect way to do it. Plus it can be scripted and automated which is an additional bonus.
Drejc
+1  A: 

What you want to do is imposition. There are commercial tools to impose PDFs such as ARTS crackerjack and Quite imposing but they are pretty expensive (US$500), require a copy of acrobat professional and are overkill for imposing 2 A4 pages to an A3 sheet.

danio
+2  A: 

Found the following (free and open-source) tool for doing Imposition called Impose (thanks danio for the tip). This solved my problem perfectly.

EDIT: Here is how it's done:

Use PDF Toolkit to joint two PDF files into one (two A4)

pdftk File1.pdf File2.pdf cat output OutputFile.pdf

Create from this a single page (one A3):

java -cp Multivalent.jar tool.pdf.Impose -dim 2x1 -verbose -paper-size "42.2x29.9cm" -layout "1,2" OutputFile.pdf
Drejc
All releases of Multivalent linked from the official sourceforge site are missing the tools package. Links to older versions can be found here: http://sourceforge.net/projects/multivalent/forums/forum/252478/topic/3442363
beerbajay
+1  A: 

This puts two landscape letter pages onto a single portrait letter sheet, to be "bound" (i.e., folded) along the top.

pdftops $1 - | 
psbook | 
pstops -w11in -h8.5in '4:[email protected](.5in,0in)[email protected](.5in,5.5in),[email protected](8in,5.5in)[email protected](8in,11in)' | 
ps2pdf - $(basename $1 .pdf).psbook.pdf

By the way, I do this often, so I'll probably submit more "answers" to this question just to keep track of successful pstops pagespecs. Let me know if this is an inappropriate use of SO.

Wang
This is exactly why SO is here ... building a knowledge base
Drejc
A: 

I had a similar problem. I tried Impose but it was giving me an

Exception in thread "main" java.lang.NoClassDefFoundError: tool/pdf/Impose
Caused by: java.lang.ClassNotFoundException: tool.pdf.Impose
(...)
Could not find the main class: tool.pdf.Impose.  Program will exit.

I then tried PDF Snake which isn't free or open source, but has a completely unrestricted 30-day trial version. It worked perfectly, after tweaking the parameters to achieve what I wanted. It's a great tool. I would definitely buy it if it wasn't so expensive! Anyway, I thought I'd leave my 2 cents in case anyone had the same problem I had with Impose.

Waldir
The error you were getting is probably due to a missing JAR or the way you have triggered impose. Note that you must have java 1.6 installed and java.exe must be in your path.
Drejc
I do have installed all the following: Java 6 SE Development Kit 6 (v.1.6.0.100), Java 6 (v. 6.0.130), and even Java DB (v. 10.4.1.3). And even though java.exe isn't in my Path system variable, if I type "java" on a console I get the command's usage instructions instead of a "command not found" error.
Waldir
The latest versions don't include the tools package; that's why you get a class not found error.
beerbajay
A: 

I just came across a nice tool on superuser.com called PDFjam that can do all of the above in a single command:

pdfjam --nup 2x1 file1.pdf file2.pdf --outfile DONESKI.pdf

It has other standard features like page size plus a nice syntax for more sophisticated collations of pages (the tricky page re-ordering necessary for true booklet-style page imposition).

It's built on top of TeX which is, whatever it is. Installing is a breeze on Ubuntu: you can just apt-get install pdfjam. On Mac OS, I recommend getting BasicTeX (google "mactex basictex"; SO thinks I'm a spammer and won't let me post the link).

This is a lot easier and more maintanable than installing both pdftk and Multivalent (on both Mac OS for dev and Ubuntu for deploy), which wasn't going so well for me anyway...!

Adam Florin