Assuming your list of pdf files looks like this
pdf1.pdf
pdf2.pdf
pdf3.pdf
Then you can use this to concatenate them into one variable
setlocal enabledelayedexpansion
set files=
for /f "tokens=*" %%a in (pdfs.txt) do (
if defined files (
set files=!files! "%%a"
) else (
set files="%%a"
)
)
pdftk !files! cat output merged.pdf
The if else
is there to remove the leading space from the variable, I wasn't sure if that would make a difference. If it doesn't then you can get rid of it and just use
setlocal enabledelayedexpansion
set files=
for /f "tokens=*" %%a in (pdfs.txt) do (
set files=!files! "%%a"
)
pdftk !files! cat output merged.pdf