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

Convert image to hexadecimal format for use in dialogs

AndrewAlb
Registered: Aug 16 2007
Posts: 97

I have a question regarding Thom Parker's custom dialog example.
I would like to import my company's logo into hexadecimal format and render it on my dialog boxes but I have two questions.
1. Is this limited to 20x20 as the importIcon is? or can I display an image of any size?
 
2. I am having trouble getting my image in a hexadecimal format that Acrobat like (even at 20x20).
It renders an image but it is all garble.
I have used two apps to convert my jpg image:
 
Picture Convert to Hex II 1.1 beta and SMSExchange Graphic Converter. - neither produce my image in acrobat only garble.
 
any thoughts or help regarding this would be appreciated.
 
-Sincerely,
Andrew Albrecht

Andrew D. Albrecht, MS
Solutions Developer
ING USFS

My Product Information:
Acrobat Pro 8, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
For an Acrobat JavaScript dialog the image has to be in ARGB format in a generic icon stream object. The specs are in the Acrobat JavaScript Reference. The image can be any size, but the larger you go the slower it gets.

You can use the "util.iconStreamFromIcon()" function on an imported or button icon. But you can also use a third party tool to do all the heavy lifting for you. There are only 3 tools in existance that will do this. PDF CanOpener, AcroButtons, and AcroDialogs. You'll find all of them at [url=http://www.windjack.com.]www.windjack.com.[/url] Since you're creating custom dialogs you should be using AcroDialogs, which is a graphical drag and drop editor for creating custom dialogs in JavaScript. Besides the image stuff it will save you hours of hand coding dialog layouts.

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