Created
January 24, 2018 03:09
-
-
Save treetrum/661f5ea75d37a5f16f56040654216cf0 to your computer and use it in GitHub Desktop.
Get a JPEG of the first page of a PDF file
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
# Extracts the first page of the PDF | |
gs -dSAFER -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile="page1.pdf" -dFirstPage=1 -dLastPage=1 {pdf-file-name} | |
# Converts that 1 page PDF into a JPEG | |
convert "page1.pdf" {pdf-file-name}.jpg | |
# Delete the 1-page pdf | |
rm "page1.pdf" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment