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

Icon Only Button Issues

mczajka
Registered: Oct 11 2005
Posts: 29

Is it possible to execute a JS across some buttons to have the bounds of the button box snap to the exact size of the pdf icon? I'm having a difficult time aligning buttons created in Photoshop, saved to PDF, and brought into a field button icon. Or if possible, is there a way to change the nudge factor in Acrobat so it is finer than the default. If I could assure all my buttons are brought in as the same button size, they would be easier to align.

My Product Information:
Acrobat Pro 8.1.2, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
There are fields properties for scaling the button icon in a number of different ways, but none for automatically sizing the button field to the icon. But there is a way. Use the "util.iconStreamFromIcon()" fucntion to get a generic icon stream, which as pixel width and height properties. From here you'll need to assume some kind of resolution number to convert between pixels and PDF points. The easiest would be to use 1pt/pixel. Then just set the field.rect property appropiately.

Nudging fields in Acrobat is a pain. I usually set the zoom really high and use the mouse.

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