Last active
April 17, 2021 00:25
-
-
Save thekalinga/97f59ab2c8f6d3c3547962ddf2596a03 to your computer and use it in GitHub Desktop.
Convert png, jpg files to pdf, combine them into a merged pdf
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
# Code for downloading Google books is present in tts-converter/DownloadGoogleBooks.kt | |
for i in $(find . -maxdepth 1 -name "*.png" -print | sort -V -k1); do pdfjam --outfile ${i//png/pdf} $i; done | |
for i in $(find . -maxdepth 1 -name "*.jpg" -print | sort -V -k1); do pdfjam --outfile ${i//jpg/pdf} $i; done | |
gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=merged.pdf -dBATCH `find . -maxdepth 1 -name "*.pdf" -print | sort -V -k1` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment