Hello all,
I'm newbie here, please forgive me if I ask something ridiculous, but...
Well I have a web application that uses a PDF form to generate a client report. This report contain some variable data and I cannot have been sucess on formatting then because (I think) the keystroke or format event dosen't occurs after that the variables are filled by the application. I cannot do the formatting before fill variable at form because data are obtained by a "black-box" component.
My JScripts are working fine, because if I open PDF file generated by the app, give focus on field that contain a text unformatted and leave it by a TAB, formatting occurs ok.
Anyone knows if its possible to format a field value on this situation?
Thanks in advance!
Best regards,
Rodrigo
So you have a couple of options. Since this is a report there is no reason the document the client recieves needs to have interactive fields on it. At least not for the fields the server is pre-filling. So why not remove the format scripts, make the fields readOnly, and fill the fields with formatted values.
The other solution is a bit awkward. Write document level script to touch all the fields on the form using the "field.focus()" function. To keep this script from running every time the PDF is opened use a hidden field to hold a state variable. The problem with this solution is that the fields will need to have "readOnly" set to false and the user will have to save the file afterward. So it's much more problematic that just setting up formatted values in the first place.
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]
Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script