Add or Update a JPG Watermark in a PDF with Acrobat VBA
Question details
Add or replace a JPG watermark or header image in a PDF through VBA automation with Adobe Acrobat.

- Product
- Adobe Acrobat and VBA
- Device & OS
- not provided
- Scenario
- A user wants to automate the placement or replacement of an image watermark in a PDF.
- Observed behavior
- The desired result is a PDF containing the new image watermark, saved through an Acrobat automation workflow.
Confirm that the full version of Adobe Acrobat is installed and licensed; Acrobat Reader cannot perform these editing operations. Identify the full paths to the input PDF, JPG image, and output PDF, and check the Acrobat SDK documentation for your version.
Automate Acrobat to add or replace the watermark
Use this approach when the watermark must be applied through VBA and Acrobat.
Acrobat's interapplication communication (IAC) interface can open a PDF from VBA and expose its JavaScript object. Acrobat's watermark APIs and security restrictions vary by version, so check the installed Acrobat SDK for the applicable method signatures and permissions.
Converting the JPG to a single-page PDF provides a source for Acrobat's addWatermarkFromFile method. If the existing header is ordinary page content rather than an Acrobat watermark, removing watermarks will not remove it.
Open the JPG in Acrobat and create a single-page PDF from it. Save the image PDF and note its full path.
In the VBA editor, create an AcroExch.App object and an AcroExch.AVDoc object, then use AVDoc.Open with the full path of the target PDF.
Use AVDoc.GetPDDoc followed by PDDoc.GetJSObject to access the Acrobat document's JavaScript interface. Consult the Acrobat SDK for how your version exposes the watermark methods to VBA.
If an existing Acrobat watermark must be replaced, use the document's removeWatermark method first. Then use addWatermarkFromFile with the image PDF as the source and set the page range and positioning needed for the header or watermark.
Use the PDDoc.Save method to save the result to a new PDF path, then close the document and release the Acrobat objects. Open the output PDF in Acrobat to verify placement on the intended pages.

Add the JPG watermark manually in Adobe Acrobat
Use Acrobat's interface when a one-off edit is sufficient and VBA automation is not required.
Add an image watermark to a PDF with WPS Office
For a manual alternative, use WPS PDF's watermark tools to place an image and save the edited PDF. This does not automate Adobe Acrobat through VBA, and PDF editing features may require a subscription.
- 1. Open the PDF: Launch WPS Office and open the target file in WPS PDF.
- 2. Open watermark settings: On the PDF editing toolbar, choose Watermark, then select the option to add a watermark.
- 3. Choose the image: Select an image as the watermark source, browse to the JPG, and adjust the available placement, size, and page-range settings.
- 4. Save the result: Apply the watermark and use Save As to create an edited PDF. Review the saved pages to confirm the image is positioned correctly.

Frequently Asked Questions
Can Adobe Acrobat Reader add a watermark through VBA?
No. Acrobat Reader cannot perform the PDF editing operations needed for this workflow. Use a licensed full version of Adobe Acrobat and check its IAC and JavaScript support.
Why should I convert the JPG to a PDF before using Acrobat's JavaScript API?
Acrobat's addWatermarkFromFile method uses a PDF as the watermark source. Create a single-page PDF from the JPG in Acrobat, then provide that PDF's full path to the method.
Will removing a watermark delete a header image embedded in the page?
Not necessarily. Acrobat's removeWatermark method targets watermarks; an image inserted as ordinary page content may need to be removed separately with an editing tool.
Can I control which pages receive the watermark?
Yes. Set the page range in Acrobat's Watermark dialog for a manual edit, or use the page-range parameters documented for addWatermarkFromFile in the Acrobat SDK.
Why might an Acrobat automation method be blocked?
Some Acrobat JavaScript operations are restricted by security settings or execution context. Check the method's documentation in the Acrobat JavaScript API reference and confirm that the installed Acrobat version and license support the operation.




