Skip to content

Instantly share code, notes, and snippets.

@binhqd
Last active January 5, 2018 04:14
Show Gist options
  • Save binhqd/80b36e659405b48dbfdb2d778ef6be06 to your computer and use it in GitHub Desktop.
Save binhqd/80b36e659405b48dbfdb2d778ef6be06 to your computer and use it in GitHub Desktop.
PDF processing with GhostScript
# Export pages with range of a PDF file
s -dNOPAUSE -dBATCH -sDEVICE=png16m -r150 -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -dPDFFitPage -dFirstPage=1 -dLastPage=10 -sOutputFile="Pic-%d.png" ESB-WSO2-Introduction.pdf
# Get total pages of a PDF file
gs -q -dNODISPLAY -c "(abc.pdf) (r) file runpdfbegin pdfpagecount = quit"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment