Skip to main content
Thanbor
Participant
March 15, 2022
Question

Using VB/VBA to apply stamps on PDFs.

  • March 15, 2022
  • 2 replies
  • 1023 views

I know stamps can be manually applied using Acrobat Reader DC, but we produce some very large PDF documents where certain pages are required to be stamped as "Approved" and "Reviewed". Some of the PDFs can be over 3000 pages and have several hundred that need to be stamped. Doing this manually can take over an hour.

 

I have built a Visual Basic program to apply the appropriate stamps, and it works on my computer, but my computer has Adobe Acrobat DC installed. This program needs to work with our other workstations that have only Acrobat Reader DC installed.

 

The reference I am using in my VB Project is "Acrobat" and the installed path is C:\Program Files\Adobe\Acrobat DC\Acrobat.tlb. The odd thing is that the reference selection window shows it as "Acrobat" but once included in the project it shows "Adobe Acrobat 10.0 Type Library"

 

Currently, when I run the program on a Reader workstation I get an error that ActiveX cannot create these objects:

 

Dim MyAVDoc As Acrobat.AcroAVDoc

Dim MyPDDoc As Acrobat.CAcroPDDoc

 

Set MyAVDoc = CreateObject("AcroExch.AVDoc")
Set MyPDDoc = CreateObject("AcroExch.PDDoc")

 

What am I doing wrong? Is there a setting in Reader DC that would enable this to work. Is this even possible using only Acrobat Reader DC? 

 

Thanks!

 

This topic has been closed for replies.

2 replies

Participating Frequently
September 2, 2022

It looks like you were able to get this to work using Acrobat. Do you have aany code to share that actually adds the stamp? Thanks!

try67
Community Expert
Community Expert
September 2, 2022

You can use the addAnnot method to do it. You will need to know (or calculate) the stamp's location on the page, which is expressed using the rect property, as well as its internal name, which is expressed using the AP property, as well as a couple of other, simple parameters.

Legend
March 15, 2022

You are using the Acrobat SDK, which is a tool for automating Acrobat. It's Acrobat the does the work, and only Acrobat has these interfaces. Think of it this way: the Acrobat SDK is a marketing tool for Acrobat. Adobe will be delighted to sell you Acrobat for each of your users. Sounds as if it will pay for itself pretty quickly too.