Merge multiple pdf pages into specific pdf page using pdftk
Asked Answered
B

1

9

I have merged.pdf file with 18 pages. I would like to merge into source.pdf file starting from page 46 and get final.pdf using PDFTK

I tried with this command, but it didn't work:

pdftk A=source.pdf B=merged.pdf cat A1-45 B1-18 A64 output final.pdf

Any idea?

Bracteate answered 22/5, 2017 at 1:58 Comment(0)
I
14

Only a little correction of your original proposal is needed:

pdftk A=source.pdf B=merged.pdf cat A1-45 B A46-end output final.pdf

You don't have to write "B1-18" to refer to the whole document. You can just use "B" to indicate an entire PDF. BTW, you can also use "end" if you want to refer to the last page, e.g. "B1-end"

"A64" in your example means "catenate page 64 of source document" but - if I understand it correctly - you want to put those 18 pages inside larger document and you don't want to lose any page of any of those two documents, right?

Then you need to catenate first 45 pages of the source document (which translates to "A1-45"), then 18 pages of the merged document ("B"), and finally all the pages from page 46 to the end of the source document ("A46-end").

Imbibe answered 27/5, 2017 at 22:31 Comment(1)
This will merge two PDFs, however it will break the content links. A better approach would be to use ghostscript, as explained here: superuser.com/a/1348269/1101909Acute

© 2022 - 2024 — McMap. All rights reserved.