Merge PDF using VBA

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
Orloff34
User
Posts: 3
Joined: Thu Jan 21, 2021 2:43 pm

Merge PDF using VBA

Post by Orloff34 »

Dear forum,

we are using PDF-XChange Editor Plus (Version 8.0, Windows 10) in our company. For my task I need to merge several pdf files created with Excel to single pdf file using VBA.

I could do this command line but I am asking myself whether there is also an API available to do this task.

I want to replace the following command line:

Code: Select all

PDFXTools.exe /RunTool:showui=no;showprog=no splitMergePDF d:\T1.pdf d:\T2.pdf /Output:folder=D:\;filename=Merge.pdf;showfiles=no;overwrite=yes
But I experienced some runtime issues using this command and adding the files with for loop to add the files consecutivly with following command

Code: Select all

PDFXTools.exe /RunTool:showui=no;showprog=no splitMergePDF d:\Merge.pdf d:\T(i).pdf /Output:folder=D:\;filename=Merge.pdf;showfiles=no;overwrite=yes.
The command is adding a file to the already existing Merge.pdf and is overwriting itself. This works well until the file Merge.pdf gets larger and next command line call is performed before the previous is finished and Merge.pdf is still in use.

So any ideas who to solve issue? Can I create file list and handle it via the command line? Or is there an API which I can use avoiding this problems?

Best regards
Orloff34
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom
Contact:

Re: Merge PDF using VBA

Post by John - Tracker Supp »

Hi,

accessing the API using an End User license is prohibited under the terms of the license I am afraid.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com
Orloff34
User
Posts: 3
Joined: Thu Jan 21, 2021 2:43 pm

Re: Merge PDF using VBA

Post by Orloff34 »

What about creating a file list as a .txt file with the path and filename and pass the txt file via the command line to the splitMergePDF Tool?

Best regards
Orloff34
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8593
Joined: Wed Jan 03, 2018 6:52 pm

Re: Merge PDF using VBA

Post by TrackerSupp-Daniel »

Hi, Orloff34

PDF-tools does indeed offer a "filelist" function, as well as numerous other configurable "actions". You can follow the steps here to create a custom tool which will do exactly as you need, and then use the command line functions here to run it without trouble.

Kind regards,
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
Orloff34
User
Posts: 3
Joined: Thu Jan 21, 2021 2:43 pm

Re: Merge PDF using VBA

Post by Orloff34 »

Hi Daniel,

thank you for your support. :D After following the knowledge base and using the correct command line options it works fine even with 80 single files creating a single pdf of about 35 MB...

Best regards
Orlofff34
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8593
Joined: Wed Jan 03, 2018 6:52 pm

Merge PDF using VBA

Post by TrackerSupp-Daniel »

:)
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