These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

How to insert a jpg into pg 2 of a pdf with VB

iluvstrats
Registered: Oct 16 2007
Posts: 19

I'm trying to figure out how to open pg 2 of a pdf and insert a jpg at a specified coordinate using VB.

Is this possible and if so does anyone have any sample code.

Thanks

My Product Information:
Acrobat Pro 8.0, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Yes, there is a way to do this. Actually a couple ways, but they can only be done with Acrobat Professional.

1. Images can be imported in to a PDF as button icons. Write a JavaScript function that adds a button field to the PDF at the correct location and then imports the jpeg as the button image.

2. Use the addWatermarkFromFile() function in Acrobat JavaScript to place the JPeg. This is a slightly easier technique.

Both of these methods use Acrobat JavaScript. Which can be accessed throught the JSO object in your VB program. The best approach is to create a folder level JavaScript file that defines a trusted function that performs the operation. Then call this function from the VB program.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script