Scripting to print thousands of files to PDF, and then combine them

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Post Reply
researchguy007
User
Posts: 11
Joined: Sun Aug 23, 2015 2:33 pm

Scripting to print thousands of files to PDF, and then combine them

Post by researchguy007 »

For a legal document disclosure task, I need to write a script that will traverse a folder structure and print to PDF any file that can be printed, *if it is not already a PDF.* Mostly this would be Word documents and maybe some JPG's. I see that those by default print to a smaller page with no margins. I would of course preferred that they print to the same size page, typical letter-size, with a 1 inch margin. For the Word docs the margins can be whatever they are in the Word docs.

I don't want to have to click "Print" or "OK" for each file. I asked about this maybe over a year ago and was told there was no way to avoid that. It would surprise me if nobody has solved this problem. If you are printing to a printer you don't have to do anything for each file. You can select as many files as you want, select "Print" from the right-click menu, then go to lunch and come back and it will be done -- to the default printer. Obviously you should do it one time manually to select the correct output folder. They should be a way to tell PDF-XChange Editor to simply use that default folder and not prompt me.

As a fallback position, maybe there is a Word VBA programmer here who can post a code snippet to concatenate all the Word files in a folder structure.

It's too bad I can't use the DOS command COPY with the + parameter. I know how to do that with text files and it has made me look like a miracle worker.

After all that's done, I will also need a way to combine multiple PDFs from those folders into single PDFs, but with a maximum file size of 50 MB each. It's irrelevant whether little PDFs from multiple folders get combined into one big PDF and then part of what's in another folder goes into the next big PDF.

As a fallback position I could combine all 3000-4000 PDFs into one huge PDF, and then manually break it up into chunks of about 50 MB each. But that would be another long manual operation.

There was a French company had produced an excellent Windows scripting system called WinTask, and I'm sure that I could have automated either of these tasks using that system, but that ccompany went out of business years ago.

Thanks in advance for any help!
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17948
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Scripting to print thousands of files to PDF, and then combine them

Post by Tracker Supp-Stefan »

Hello researchguy007,

Have you tried our new PDF Tools?
https://www.pdf-xchange.com/product/pdf-tools
Using that you can combine multiple file formats (Word, Excel, txt, most image formats) directly into PDF file(s), however for sorting out the file size - you will need to first merge them all together, and then you have several plit options - unfortunately neither of which allows you to limit by size.

Regards,
Stefan
researchguy007
User
Posts: 11
Joined: Sun Aug 23, 2015 2:33 pm

Re: Scripting to print thousands of files to PDF, and then combine them

Post by researchguy007 »

Thanks, Stefan! I'll check it out.
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8611
Joined: Wed Jan 03, 2018 6:52 pm

Re: Scripting to print thousands of files to PDF, and then combine them

Post by TrackerSupp-Daniel »

Let us know if it works for you! :)
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Post Reply