I have a fillable form that is Reader Extended (so it can be saved from Adobe Reader). After a user fills in the form, he clicks a submit button that sends a data stream to a servlet. The servlet embeds this data as XML in another version of the form, converts the form to be PDF/A compliant, and returns the new PDF/A form with embedded data. That all works fine when the fillable form was open in either Reader or a web browser. But if the user has the fillable form open in Acrobat when he clicks the submit button, the embedded data is stripped out of the PDF/A form that's returned by the servlet.
It's not a problem if the user fills in the data while the form is open in Acrobat, as long as he closes the form and opens it in Reader or a web browser before clicking the submit button.
Is there a way to detect if the fillable form is open in Acrobat (perhaps in the preSubmit event?) so I can display a message warning the user to save and close the form, and then open it in Reader or a web browser before clicking the submit button?
Here is a document that can help you..
http://www.adobe.com/devnet/livecycle/articles/lc_viewer_version.pdf
Thanks
Srini
Thanks, Srini, this told me how to get the name of the viewer (ex. Reader vs. Exchange-Pro). Unfortunately, viewerType doesn't seem to distinguish between the form being open in just plain Acrobat versus being open in Internet Explorer - the viewer type is the same for both (Exchange-Pro).
It looks like there's a userAgent value that can distinguish between Acrobat and a browser - is this a value that I can access from a Designer form?
Thanks.
Alice
Views
Replies
Total Likes
The below script can provide you whether it is Acrobat or not..
xfa.host.name
Thanks
Srini
Views
Replies
Total Likes
I added the following code to my submit button, but it gives me the same appType and host.name values for IE and Acrobat, so I can't tell them apart:
var
viewerType = xfa.host.appType;
var
viewerName = xfa.host.name;
xfa.host.messageBox("Viewer is "
+ viewerType);
xfa.host.messageBox("Host is "
+ viewerName);
viewerType is Exchange-Pro
viewerName is Acrobat
Views
Replies
Total Likes
You need xfa.host.version.
I recommend downloading a copy of the LiveCycle Designer Scripting Reference - you'll find it all in there.
Views
Replies
Total Likes
I also want to find out if the PDF form was opened in Acrobat or Browser.
I tried xfa.host.name and I am always getting "Acrobat". For example, if I open the PDF from IE using Ctrl-O and display the value of xfa.host.name I always get "Acrobat",
I think the best way is to check the doc.path or doc.URL (using event.target). If the path or URL starts with "http://" then most likely the PDF form was opened from the web server using a browser.
Appreciate your feedback.
Tarek
Views
Replies
Total Likes
xfa.host.name will always give you the name of the XFA renderer (e.g. Acrobat, Reader),not the container (standalone, IE, Firefox). Therefore, your approach makes sense.
Thank you jnicholas330 !
As per this article I should get the browser name.
However, my approach is working fine so far.
Tarek
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies