Last active
December 23, 2015 09:53
-
-
Save prasetiyohadi/51fc101fea0e5af7a0fc to your computer and use it in GitHub Desktop.
Convert file types and optimize PDF file
This file contains 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 | |
# using imagemagick package | |
# convert *.png file to *.jpg file | |
convert file.png file.jpg | |
# convert *.jpg file to *.pdf file | |
convert file.jpg file.pdf | |
# using ghostscript package | |
# optimize PDF file | |
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment