views:

178

answers:

1

How could I merge / convert multiple pdf files into one large pdf file?

I tried the following, but the content of the target file was not as expected:

convert file1.pdf file2.pdf merged.pdf

I need a very simple/basic cli solution. Best would be if I could pipe the output of the merge / convert straight into pdf2ps ( as originally attempted in my previously asked question here: http://stackoverflow.com/questions/2507596/linux-piping-convert-pdf2ps-lp ).

+3  A: 

I'm sorry, I managed to find the answer myself using google and a bit of luck : )

For those interested;

I installed the pdftk (pdf toolkit) on our debian server, and using the following command I achieved desired output:

pdftk file1.pdf file2.pdf cat output -

This in turn can be piped directly into pdf2ps.

Bor
Using ghostscript also might work: `gs -q -sPAPERSIZE=letter -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=out.pdf in1.pdf in2.pdf in3.pdf ...`
Nate Kohl
I'd have to look more into the possible options/flags (because I don't want output in a file), but probably yes. Thank you for the suggestion.
Bor