Skip to content

Instantly share code, notes, and snippets.

@chrdek
Created January 5, 2018 11:28
Show Gist options
  • Save chrdek/3c1482e8d6d987d68b5a3672b20c85a5 to your computer and use it in GitHub Desktop.
Save chrdek/3c1482e8d6d987d68b5a3672b20c85a5 to your computer and use it in GitHub Desktop.
PDF convert pages to image and add to archive (Using 7zip and Imagemagick)
REM Change the extension of the output file accordingly:
REM jpg jpeg,png,gif,tiff
cls
@echo Convert/Zip operation of pdfs started...
@echo off
@echo.
forfiles /m *.pdf /C "cmd /C convert -density 300 -compress lzw @file [email protected]"
dir *.png /B >> listfile.txt
"%ProgramFiles%\7-Zip\7z.exe" a -tzip -mx=8 pdf2png.zip @listfile.txt
del /q *.png
del /q listfile.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment