Skip to content

Instantly share code, notes, and snippets.

@chrdek
Last active January 16, 2018 18:11
Show Gist options
  • Save chrdek/0338184f5fc412a5c5e5abec92e4238d to your computer and use it in GitHub Desktop.
Save chrdek/0338184f5fc412a5c5e5abec92e4238d to your computer and use it in GitHub Desktop.
PDF files stapler using convert from imagemagick
cls
@echo Merging set of pdf files under %USERPROFILE%\Documents\mypdfs\ ..
@echo off
@echo.
set pdfpath= %USERPROFILE%\Documents\mypdfs\
rem Enable this line to avoid long file path name problems:
rem set pdfpath=%SystemDrive%\1\
for /r %pdfpath% %%i in (*.pdf) do echo | set /p pdfnames="%%i " >> %pdfpath%output3.txt
set /p outpdf=< %pdfpath%output3.txt
convert -density 180 %outpdf% %pdfpath%allinone.pdf
del /Q %pdfpath%output3.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment