Remix.run Logo
diggan 2 days ago

> joining multiple PDFs together

What about joining page 2-3 from PDF A with page 7-23 from PDF B? I remember that being a huge hassle on macOS when I was using it years ago. Think I ended up using some cloud service/website for it since the documents weren't confidential at all.

episteme 2 days ago | parent | next [-]

Can’t you just drag and drop across preview windows?

JKCalhoun 2 days ago | parent | next [-]

You can — just drag the thumbnails.

The only downside to this, that I am aware of, is that a new PDF is created (rendered into a new PDF context). That can be lossy in some cases (if there are features that Preview does not support that get "dropped on the floor") and it is possible for the resulting PDF to be larger than the original(s).

diggan 2 days ago | parent | prev [-]

Woah, page-by-page? I wasn't aware of that, I guess I'll give it a try the next time I'm in front of a Mac and need to join PDFs again :)

jbn a day ago | parent | prev | next [-]

my go-to tool for this is pdftk.

See https://www.pdflabs.com/docs/pdftk-cli-examples/

wonger_ 2 days ago | parent | prev | next [-]

qpdf is usually my PDF wrangler of choice:

  qpdf --empty --pages a.pdf 2,3 b.pdf 7-23 -- out.pdf
mynameismon 2 days ago | parent | prev [-]

For those who have an installation of LaTeX: It is pretty easy to use LaTeX for this.

diggan 2 days ago | parent [-]

> It is pretty easy to use LaTeX for this.

Without looking it up the arguments/syntax, how do I do "join page 2-3 from PDF A with page 7-23 from PDF B"?

If it's more than one CLI invocation, easy to remember/find in the shell history and less than 80 characters long, I'm not sure I'd call it easy :)

fooofw 2 days ago | parent [-]

pdfjam [1] uses a LaTeX package under the hood, is included with the TeX Live distribution and acts as a wrapper for a LaTeX package. With this, I believe your example would be:

    pdfjam PDF_A.pdf '2-3' PDF_B.pdf '7-23' --outfile joined.pdf
I'll admit that I had to look it up but that only took about 3 minutes (it's an example in the readme).

[1] https://github.com/pdfjam/pdfjam