Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've been looking everywhere (i.e. lots of Google searching) for pdfconcat, which supposedly is very good at merging PDF files together.

Anyone know where I can get this?

Thanks!

share|improve this question
    
Have you really tried to google pdfconcat linux? –  mouviciel Nov 28 '11 at 11:04
1  
Yes, yes I have. –  Alasdair Nov 28 '11 at 11:40
    
Yes, I saw that. Not sure it's the same one though. The one I'm looking for is command line, and I thought it actually did the merging itself. Whereas that is just a GUI for PDFTK. –  Alasdair Nov 28 '11 at 11:51
    
Have you had a look at pdfsam? It apparently has a command line interpreter and I've always been impressed with the functionality and lack of bloat on the output... –  Mokubai Nov 28 '11 at 11:59

3 Answers 3

I am the author of pdfconcat. The offical source code download site of pdfconcat is http://pts-mini-gpl.googlecode.com/svn/trunk/pdfconcat/ . Example command-line for cancatenation of t1.pdf, t2.pdf and t3.pdf to t.pdf (type it without the $ in the beginning):

$ pdfconcat -o t.pdf t1.pdf t2.pdf t3.pdf

pdfconcat is now a bit out of date, for example it cannot read PDFs with cross-reference streams or object streams. Since these would be complicated to implement (i.e. it would blow up the source code of pdfconcat by a factor of 10 or more), I don't think they will be implemented in pdfconcat.

As of now I recommend qpdf instead of pdfconcat for PDF concatenation. qpdf can generate small output files (if you use the command-line flags --stream-data=compress --object-streams=generate; but using --normalize-content=y will most probably make the output PDF larger). Example command-line with qpdf (version 3.0.0. source code download link) for PDF concatentation (it's deliberate to have the first filename twice):

$ qpdf t1.pdf --pages t1.pdf 1-z t2.pdf 1-z t3.pdf 1-z -- t.pdf 

As seen in other answers, you may also try pdftk (also available as an Ubuntu package) instead of pdfconcat for PDF concatenation. I tried pdftk now, and it didn't generate too large output files for me. If you get a very large file size with pdftk (i.e. much larger than the sum of the input sizes), send me your input PDFs (because I'm interested in what's going on). Example command-line with pdftk:

$ pdftk t1.pdf t2.pdf t3.pdf cat output t.pdf

For Unix systems there is the pdfjoin shell script (part of pdfjam, also available as an Ubuntu package), but it has a very heavy-weight dependency: pdfLaTeX and the pdfpages.sty LaTeX-package).

Please note that none of the concatenation methods above preserve all hyperlinks in the document (especially hyperlinks in a non-first input file). Please do adequate testing if your concatenation method preserves all the interactive PDF features you care about.

share|improve this answer
    
I used pdftk for this purpose for a long time, and would advise others against hitching their wagons to it. It's very buggy and poorly engineered. It uses a library called iText. The author of iText changed the license, so the author of pdftk forked his own version of the library. This forked version is buggy and does not seem to be actively maintained. It doesn't support pdf 1.5 properly. There is also no real error reporting. When iText raises an exception, pdftk throws away the info about what the error is and just gives a generic report of "Input errors." –  Ben Crowell Jul 21 at 14:50

Are you sure it's pdf concat? Maybe you may try pdftk, which provides exactly the functionality, you describe.

share|improve this answer
    
Nope, I know that pdftk can do it, but the filesize gets unnecessarily large when doing it with pdftk. I was hoping pdfconcat would be better. –  Alasdair Nov 28 '11 at 11:41

A google search on pdfconcat linux gives Download PDF Concat 0.1 for Linux.

One of the requirements is pdftk, so I doubt that it will solve your current problem.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.