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

About Dialog

chaida
Registered: Sep 9 2008
Posts: 34

Hi,

I'm trying to create an about dialog with javascript. I would like to know if there is a way to put an image in the created dialog?

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Why yes there is. There is an "image" element, and the value of the image element is a generic icon stream. you load the icon stream into the image element exactly like you'd load a value into a dialog text element. One way to do this is to place an invisble button on your PDF that has the image in it. Then use the "util.iconStreamFromIcon()" function to convert the button icon into one that you can use for the dialog.

Of course I think the easiest way to both create a dialog layout and to add portable images to the dialog is with [url=http://www.windjack.com/products/acrodialogs.php]AcroDialogs[/url]. It saves headaches. Gets you past the messy bit of creating the dialog and into the business end of writing your code.

You'll also find an about dialog example at www.pdfscripting.com

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