Skip to content

Instantly share code, notes, and snippets.

@craigmccauley
Created October 26, 2020 15:22
Show Gist options
  • Save craigmccauley/797b9f8e4184e37855bdfc95fe9a83a1 to your computer and use it in GitHub Desktop.
Save craigmccauley/797b9f8e4184e37855bdfc95fe9a83a1 to your computer and use it in GitHub Desktop.
Merges all PDF files in the current directory into a merged.pdf file. Requires pdfmerge to be installed https://github.com/metaist/pdfmerge/blob/master/releases/pdfmerge-latest-setup.exe
@echo off
SETLOCAL EnableDelayedExpansion
set command=pdfmerge
for /r %%i in (*.pdf) do (
set command=!command! "%%i"
)
set command=!command! -o merged.pdf
@echo !command! >> temp.bat
call temp.bat
del temp.bat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment