• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

merge documents via VBA

New Here ,
Apr 26, 2019 Apr 26, 2019

Copy link to clipboard

Copied

I've been using a 3rd party tool to merge documents from an Access database for several years.  My client was using Acrobat 9.xx but recently upgraded to Acrobat 2017 and the code no longer works.  This process merges as many as 100 pdf files, one at a time, into a master report for my client is critical as they perform this action several times a quarter.

As I said, we have been using a 3rd party tool and I basically shell out a simple command to merge two documents into a third:

pdftk C:\...\Budget\2019-03-06-09-51.pdf C:\...\Budget\002.pdf cat output C:\...\Budget\Temp.pdf

Can I do this with Acrobat 2017?

TOPICS
Acrobat SDK and JavaScript

Views

877

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 26, 2019 Apr 26, 2019

Copy link to clipboard

Copied

Are you doing this on a server, or in a server like environment? This means, can somebody without a license to Acrobat potentially use this functionality? If that's the case, then you cannot use Acrobat for this.

If that's not true, then Acrobat is an option. How to you determine which files need to be merged? You could potentially kick off the merge from within Access using VBA. Take a look here for some ideas about how this would look:

Adobe Acrobat and VBA - An Introduction - KHKonsulting LLC

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 26, 2019 Apr 26, 2019

Copy link to clipboard

Copied

@Karl,

No, not in a server environment, Acrobat 2017 will be installed on the same computer as is running the Access application.

Thanks for the code, I'll get back to you once I've got a test environment setup and can test this out.

I would have preferred a single command line, but I can deal with adding a code module to what I already have.

Dale

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 26, 2019 Apr 26, 2019

Copy link to clipboard

Copied

Why can't you use pdftk?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 26, 2019 Apr 26, 2019

Copy link to clipboard

Copied

User has been using Acrobat 9.xx and the code has been working fine, but when they installed Acrobat 2017, the code locks up on the shell command.

I tried to contact the author of the PDFtk, but received no response, so I'm looking for alternatives.  Since they own a copy of Acrobat 2017, I thought I would try here first.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 28, 2019 Apr 28, 2019

Copy link to clipboard

Copied

pdftk will work with or without Adobe Acrobat.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 29, 2019 Apr 29, 2019

Copy link to clipboard

Copied

yes, it does. But in this case, there seems to be a conflict of some sort, because the code works great with Acrobat 9.xx installed but fails when Acrobat 2017 is installed (same computer, same version of Office).  So I can only assume that there is something going on with the actual PDF software.

Finally got the client to set me up with a virtual environment that I can work in with the same versions of software in use at his site, so I should be able to perform some more testing during this week.

Dale

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 29, 2019 Apr 29, 2019

Copy link to clipboard

Copied

pdftk is a completely separate package, which has nothing to do with Acrobat, so in theory, changing from Acrobat 9 to DC should not change it's behavior. You may want to see if something else changed on that system that could have potentially interfered with pdftk.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 29, 2019 Apr 29, 2019

Copy link to clipboard

Copied

Karl,

I understand that PDFtk is a completely different tool.  But in this scenario, the client did:

1.  Got a new computer (Win 10, Access 2016) and migrated the database application and the Acrobat 9.xx application to her computer. At that point, the Access application worked fine

2.  Installed Acrobat 2017 (is that the DC version)?  Tried to run the Access application which froze up as soon as it got to the shell command which merges two pdfs into a third.  Access simply locks up, no error messages or anything.  Only way to close the application is via Task Manager.

3.  Uninstalled Acrobat 2017 and reinstalled Acrobat 9.xx.  Access application now runs fine and generates the 280+ page PDF file from over 85 separate PDFs.

No other changes have been made since migrating everything to the new computer.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 29, 2019 Apr 29, 2019

Copy link to clipboard

Copied

Did it work when you un-install Adobe Acrobat?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 29, 2019 Apr 29, 2019

Copy link to clipboard

Copied

LATEST

That's why I said "in theory"

Adobe now has to different ways for you to get Acrobat: As a subscription, or as a perpetual license. The subscription version is DC, and it gets updates every three months. The perpetual license version is 2017 (or 2015, or 2019), and gets updated at the normal about every 2 years frequency. As far as you are concerned, there are no differences between 2017 and DC, the API is the same.

Without having access to the system in question it's possible to say what's going on and why pdftk stopped working. You may get some information when you run the appropriate pdftk command in a command tool to see if it reports any problems.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines