Skip to content

Instantly share code, notes, and snippets.

@flozano
Last active March 16, 2020 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flozano/55df6ea4e8e2a15c101f79aa08553414 to your computer and use it in GitHub Desktop.
Save flozano/55df6ea4e8e2a15c101f79aa08553414 to your computer and use it in GitHub Desktop.
pdf
#!/bin/bash
# Merge pages from a1 and a2 into b
qpdf --empty --pages a1.pdf 1-z a2.pdf 1-z -- b.pdf
# Merge pages from a* into b
qpdf --empty --pages $(for i in a*.pdf; do echo $i 1-z; done) -- b.pdf
# Remove password
qpdf -password=mypassword -decrypt source_with_password.pdf target_without_password.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment