2

I would like to add an existing PDF file to another existing PDF file after a given page and not necessarily at the end of the file. How can I do this in Linux without degrading the quality of the PDF file?

To be clear, my scenario is this: I got PDF file, called file_2.pdf, which I would like to add to another PDF file, called file_1.pdf. The file file_1.pdf has got, let's say, 100 pages and the file file_2.pdf is made up of three pages named a, b and c. I would like to add file_2.pdf after page 35 of file_1.pdf, so that the resulting file's pages are in this order: 1, 2, 3, ..., 32, 33, 34, 35, a, b, c, 36, 37, 38, 39, ..., 98, 99, 100.

It is very important for me that the resulting file not lose any quality in the process.

  • 1
    With pdftk, it should be as simple as pdftk A=file_1.pdf B=file_2.pdf cat A1-35 B A36-end output out.pdf - but I can't test that atm – steeldriver May 29 '17 at 14:48
  • As steeldriver outlines, this is trivially possible using pdftk. Try it and see. And the command looks correct to me. – Faheem Mitha May 29 '17 at 17:25
1

I often use pdf2ps to convert pdf to poscript.

Then I use psselect and psmerge to select pages and concat them.

Then I use ps2pdf to convert the result back to pdf.

On my computer I see pdfjoin which should do the trick, from what I read from its man page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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