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

Image with transparancy in app.addToolButton

roggeheflin
Registered: Oct 7 2008
Posts: 19
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});

My Product Information:
Acrobat Pro Extended 9.0, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
How are you converting the JPG image to an icon stream? This is not a trivial task.
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

roggeheflin
Registered: Oct 7 2008
Posts: 19
I am using adig.jar (see link in my first post). PNG and GIF formats dot not convert properly and JPG, from what I know, does not have the Alpha channel.

I examined AcroButtons: The image was re-sized and for as few icons that need to be made, the price is too high.