Created
December 3, 2019 04:34
-
-
Save riyadhalnur/6290db961a245b1fdcb8fee452792a06 to your computer and use it in GitHub Desktop.
GhostScript Conversions
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
# Convert JPG to PDF | |
gs -sPAPERSIZE=a4 -sDEVICE=pdfwrite -o output.pdf /usr/share/ghostscript/9.27/lib/viewjpeg.ps -c "(input.jpg) viewJPEG" | |
# Convert PDF to JPG | |
gs -sDEVICE=jpeg -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -r300 -o output.jpg input.pdf | |
# Convert PDF to JPG, only 1st page | |
gs -sDEVICE=jpeg -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -dFirstPage=1 -dLastPage=1 -r300 -o output.jpg input.pdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment