Skip to content

Instantly share code, notes, and snippets.

@floydpink
Last active October 13, 2015 15:48
Show Gist options
  • Save floydpink/4218972 to your computer and use it in GitHub Desktop.
Save floydpink/4218972 to your computer and use it in GitHub Desktop.
Convert all JPGs in a folder to PDFs with same file name
gm mogrify -output-directory low-res -resize 60% *.png
K:\Docs\Filled>for /f "delims=| usebackq" %j in (`dir *.jpg /B`) DO "c:\Program Files (x86)\GraphicsMagick-1.3.12-Q16\gm" convert "%~nj.jpg" "%~nj.pdf"
pdftk pdf1.pdf pdf2.pdf cat output merged-pdf.pdf
for /f "delims=| usebackq" %j in (`dir *.png /B`) DO gm convert "%~nj.png" "%~nj.pdf"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment