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

Image resizing and moving through JS - Possible?

Moop
Registered: May 18 2010
Posts: 14

I've been looking through the reference to try and find methods that could be useful for the automation of image resizing and movement to a predefined size and set of places after an image has been placed with Place Image(I didn't see an existing method for that either). I haven't had too much luck though

Does anybody know of existing methods for these or would I have to use Cos methods? Is this possible with Javascript or would I have to develop a plugin with C/C++?

My Product Information:
Acrobat Standard 9.3.1, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Images and graphics in the content of the PDF are not directly accessible to JavaScript. However, there are two ways images can be added to a PDF through a script.

1. With the "doc.addWatermarkFromFile()" function. This function adds to the static content of the page. After placement the image cannot be changed or moved.
2. Button Fields can display an image. Buttons can be easily hidden, shown, reized, and moved with JavaScript at runtime. And they can be flattened in to the static page content if you want it to become permanant.

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/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

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