Gluing (Imposition) PDF documents
Asked Answered
H

11

21

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.

Hazelton answered 21/1, 2009 at 13:26 Comment(0)
H
11

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
Hazelton answered 21/1, 2009 at 17:5 Comment(3)
All releases of Multivalent linked from the official sourceforge site are missing the tools package. Links to older versions can be found here: sourceforge.net/projects/multivalent/forums/forum/252478/topic/…Europium
The tools no longer seem to be at that link. I was able to find what seems to be an old copy, but am a little scared to run it, since it could be a trojan. cksum Multivalent.jar gives 571900416 2716363 Can anyone verify that this file with this checksum is legit?Margarito
Have you tried the older versions found on sourceforge? Like this one: sourceforge.net/projects/multivalent/files/multivalent/…Hazelton
D
18

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...!

Duprey answered 23/7, 2010 at 21:26 Comment(2)
pdfjam / pdfnup can be tricky sometimes. If it reports that calling pdflatex failed and the source pdf contains landscape pages, try to rotate them to portrait (e.g. by using pdftk) before calling pdfjam.Melodic
In order to obtain an arbitrary output paper size (horizontal A0 strip) from two 420mm x 420mm PDFs, I had to supply --papersize '{420mm,841mm}' --trim '0mm 0mm -0.5mm 0mm to pdfnup in addition to --nup 2x1.Subrogation
H
11

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
Hazelton answered 21/1, 2009 at 17:5 Comment(3)
All releases of Multivalent linked from the official sourceforge site are missing the tools package. Links to older versions can be found here: sourceforge.net/projects/multivalent/forums/forum/252478/topic/…Europium
The tools no longer seem to be at that link. I was able to find what seems to be an old copy, but am a little scared to run it, since it could be a trojan. cksum Multivalent.jar gives 571900416 2716363 Can anyone verify that this file with this checksum is legit?Margarito
Have you tried the older versions found on sourceforge? Like this one: sourceforge.net/projects/multivalent/files/multivalent/…Hazelton
D
6

I would like to advertise my pdftools

It's written in Python so should run on any platform. It's a wrapper to Latex (the pdfpages packages) but can do lot of things with a single command line: merge pdf files, nup them (multiple input pages per output page) and number the pages of the output file (you specify the location and the format of the number) It still needs some work but I think it's quite stable to be usable right now :)

Disease answered 13/3, 2015 at 18:15 Comment(1)
I think this one is the most useable for me. I don't want to search the internet for old versions (Multivalent) nor compile something (podofo) nor fiddle with ps. Pdfjam didn't work for me as is does not support things like 5x2 grids or so. Thanks!Strom
S
5

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.

Senile answered 4/2, 2010 at 0:57 Comment(1)
This is exactly why SO is here ... building a knowledge baseHazelton
D
4

A nice, powerful, open-source imposition tool is included in the PoDoFo package: http://podofo.sourceforge.net/ It works for me. Some imposition plans can be found at: http://www.av8n.com/computer/prepress/ PoDoFo can do lots of other stuff, not just imposition.

Another useful imposition tool is Bookbinder (on the quantumelephant site). It has a GUI that appeals to non-experts. It is not as flexible or powerful as PoDoFo, but it can do imposition.

pdftk is more-or-less essential to have, but it will not do imposition.

pdfjam is useless to me, because there are a wide range of valid pdf files that it cannot handle.

I've never been able to get multivalent to work, either.

Daggett answered 13/6, 2011 at 18:18 Comment(0)
I
2

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.

Implore answered 21/1, 2009 at 14:57 Comment(0)
T
1

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.

Toms answered 21/1, 2009 at 13:47 Comment(1)
After going crazy with NoClassDefFoundError messages, it turns out that the only working JAR I could find was vrspace.org/sdk/java/multivalent/Multivalent20060102.jarDru
D
1

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.

Dabble answered 21/1, 2009 at 13:57 Comment(4)
I also thought about such solution, will test if the quality is good enought for comercial magazine print.Hazelton
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?Hazelton
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.Implore
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.Hazelton
T
1

You can put multiple input pages on one output page using BookletImposer.

And you can change page orders and combine multiple pdf files using PDF Mod.

With these two tools, you can do almost everything you want with pdf files (except editing their content).

Thug answered 18/3, 2013 at 11:56 Comment(0)
S
0

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.

Shaky answered 4/2, 2010 at 15:43 Comment(3)
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.Hazelton
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.Shaky
The latest versions don't include the tools package; that's why you get a class not found error.Europium
S
0

look at this

http://sourceforge.net/projects/proposition/

It needs laTex to run, but when it does, works really fine

Regards

Sulphanilamide answered 30/12, 2010 at 14:38 Comment(1)
As far as I can tell, this is also just wrapper around latex, this time written in ruby. And FWIW, it doesn't work for me, while pdfjam does. YMMV.Mangonel

© 2022 - 2024 — McMap. All rights reserved.