Created
July 24, 2014 00:07
-
-
Save jchysk/f7230a58f49745dec282 to your computer and use it in GitHub Desktop.
Convert jpegs to PDFs and then resize to ebook size
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
#!/bin/bash | |
for f in *.jpeg; do convert ./"$f" ./"${f%.jpeg}.pdf"; done | |
for f in *.pdf; do gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -sOutputFile="${f%.pdf}.compressed.pdf" "$f"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
PDF optimization level selection options
-dPDFSETTINGS=/screen (screen-view-only quality, 72 dpi images)
-dPDFSETTINGS=/ebook (low quality, 150 dpi images)
-dPDFSETTINGS=/printer (high quality, 300 dpi images)
-dPDFSETTINGS=/prepress (high quality, color preserving, 300 dpi imgs)
-dPDFSETTINGS=/default (almost identical to /screen)
Paper size selection options
-sPAPERSIZE=letter
-sPAPERSIZE=a4
-dDEVICEWIDTHPOINTS=w -dDEVICEHEIGHTPOINTS=h (point=1/72 of an inch)
-dFIXEDMEDIA (force paper size over the PostScript defined size)
Other options
-dEmbedAllFonts=true
-dSubsetFonts=false
-dFirstPage=pagenumber
-dLastPage=pagenumber
-dAutoRotatePages=/PageByPage
-dAutoRotatePages=/All
-dAutoRotatePages=/None
-r1200 (resolution for pattern fills and fonts converted to bitmaps)
-sPDFPassword=password