Article View: adobe.reader
Article #7813Javascript to change button display property works in all but Reader 8.0
From: MikeNoonan
Date: Tue, 13 Feb 2007 18:41
Date: Tue, 13 Feb 2007 18:41
23 lines
2032 bytes
2032 bytes
I'm working with PDF forms. The forms have a button on them with a default visibility of hidden. When called from the web, this button should become visible by a javascript function called processInit(). We have had no problems with this until Reader 8.0.
Using the FDF toolkit, the PDF form is launched from the web with this command that passes an initilization script...
objFDFDoc.FDFSetOnImportJavaScript ("processInit();", false)
processInit() makes the button visible using the following script
/* Reveal Button */
var objButton = this.getField("btn");
try {
objButton.display = display.noPrint;
}
catch (e) { }
This script DOES NOT work in Reader 8.0 when called by FDFSetOnImportJavaScript. However, once the document is loaded, if I execute processInit() manually (by assigning it to a visible button), the script executes and the hidden button becomes visible.
I have verified that the button's display property is recognized by Adobe Reader 8.0 when called by FDFSetOnImportJavaScript, but the command is ignored. I accomplished this by looping through the properties of the button and calling app.alert(button property and value).
Any ideas why Adobe Reader 8.0 is ignoring the display property when the document is loading?
Thanks
Mike
Technical Details
Message-ID:
<3bc32398.-1@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns14feed!worldnet.att.net!63.218.45.10!nx01.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!news.germany.com!news.isoc.lu!webcrossingShow Full Headers
Complete Article Headers
X-Google-Thread: 10273d,356c6954d394ed48,start X-Google-Attributes: gid10273d,public X-Google-Language: ENGLISH,ASCII-7-bit From: MikeNoonan@adobeforums.com Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns14feed!worldnet.att.net!63.218.45.10!nx01.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!news.germany.com!news.isoc.lu!webcrossing Newsgroups: adobe.reader Subject: Javascript to change button display property works in all but Reader 8.0 Message-ID: <3bc32398.-1@webcrossing.la2eafNXanI> Date: Tue, 13 Feb 2007 10:41:39 -0800 Lines: 34 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit