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

Need script when document Opens

patra
Registered: Oct 19 2006
Posts: 270

I have create A form with LiveCycle Designer and some futures may not work properly for users with Reader 6.0....
How with a script I can help the user in a alert box message that he needs Reader 7.0 and above in order the form to work properly and also to give them the link to download the proper reader version.

Thanks

My Product Information:
LiveCycle Designer, Windows
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi patra,

You can use app.alert to show a simple dialog (no links or images) letting the user know they need a newer version of Adobe Reader. You could place a link at some other place on the document or just provide the text link and the user can copy it down. You can find information on using app.alert in the Acrobat JavaScript Reference. Even though the materials are directed towards Acroforms, the same code will work in a LiveCycle designer PDF- it just needs to be entered into the LCD scripting area.

There is an article on using Alert Boxes at JavaScript Corner-
http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/popup_windows_part1/

Also, I believe if you do a search here on "app.alert" you will find many posts about it.

More complex methods are to create a custom JavaScript dialog with links and or images- see an exmaple and explanation at Joel Geraci's blog-
http://blogs.adobe.com/pdfdevjunkie/2008/08/pdf_portfolios_and_backward_co_2.php

In another of Joel's blog posts he shows another way to do this with a downloadable PDF example so you can examine the code used-
http://blogs.adobe.com/pdfdevjunkie/2008/08/pdf_portfolios_and_backward_co_4.php
Joel's posts are about portflios but the concept is the same for any PDF as far as alerting the user about version compatibility issues.

Hope this helps,

Dimitri
WindJack Solutions
www.windjack.com
www.pdfscripting.com
patra
Registered: Oct 19 2006
Posts: 270
I know with Acrobat you can put the script as Page properties>action (page open) or as document java script.
With LCD do I have to use any Event or Object?
The script Editor is locked when I am in the design View page and I have to select a Object to allow me to insert a script...
What I am doing wrong?
Thanks
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi Patra,

The code would be placed in the initiaize event for the top node of the document. Open the hierarchy window, click on the top node ( default is "Form 1") and then choose "initialize" as the event in the Show: pulldown- you can enter code for an alert box there.

Hope this helps,

Dimitri
WindJack Solutions
www.windjack.com
www.pdfscripting.com