1

I have a folder with approximately 1800 single-page PDF files, and need to combine and print them.

There are PDF files with "job cards" and "plans". Naming convention of the files is:

D010100
D010100_jc
D010200
D010200_jc
D020100
D020100_jc
D020101
D020101_jc
D030100
D030100_jc (on so on)

I would like to automatically have the job card and the related plan merged into one document. Then there would be 900 PDFs to print. How would I do that?

Also, if there is a way of batch printing the PDF files I would be interested to know.

Grateful for any help available

Thank You

1 Answer 1

1

it's a bit horrible and complicated, but here's my way:

  • You'll first need to install ghostscript.
  • Then (I'm assuming windows) run this batch for /R %%f in (*.pdf) do echo %%f >> files.txt. It'll collect all pdf files recursively inside a directory and save it to a file
  • Run gswin64c.exe -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=combine.pdf -dBATCH @files.txt in another batch file. This'll read the files.txt and add each file to a final pdf called combine.pdf

Here's the final batch. Place it in the same directory as the pdf files. Replace the directory after %PATH%; with where the ghostscript binary is located

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .