Answered
Is there a way/method to convert an image (PNG or GIF) with a transparency to use with the addToolButton command? a JPG works, but the highlighting when 'using' the button does not look as professional as it could.
thanks.
I used this to get the HEX String...
http://blogs.adobe.com/acdc/2008/05/using_image_in_acrobat_javascr.php
var strIcon = "ffd1d1d1f................."
var imgIcon =
{
offset: 0,
"width": 20,
"height": 20,
"read": function(bytes){return strIcon.slice(this.offset,this.offset+=bytes);}
};
app.addToolButton({oIcon: imgIcon, cName: "bPreparePDF", cLabel: "Prepare PDF", cTooltext: "Prepare PDFs for Client Distribution", cExec: "fPreparePDF()", cEnable: true, nPos: 0});
The icon stream format is ARGB, where the first channel is for transparency. So theoretically you can have very nice fades in to transparent areas. It's a matter of actually making the conversion from another image format.
There is a 3rd party tool for createing toolbar buttons, and it allows you to set transparent areas in an image, [url=http://www.windjack.com/products/acrobuttons/]AcroButtons[/url]. It can convert any image format that Acrobat can convert.
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]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script