Created
January 2, 2018 23:54
-
-
Save salaros/910679ac41c2b87cf149fdad1d95020e to your computer and use it in GitHub Desktop.
Splits PDF into images (one image per page), then re-combines pages into new PDF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## sudo apt install -qy ghostscript imagemagick | |
mkdir -pv pages | |
## gs -dNOPAUSE -dBATCH -sDEVICE=jpeg -r96 -sOutputFile='pages/page-%02d.jpg' 'input.pdf' | |
gs -dNOPAUSE -dBATCH -sDEVICE=pngalpha -r96 -sOutputFile='pages/page-%02d.png' 'input.pdf' | |
## convert -adjoin pages/*.png 'output.pdf' | |
convert -adjoin pages/*.png 'output.pdf' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment