Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Question About openDoc with Mac and PC

Explorer ,
Mar 23, 2017 Mar 23, 2017

I have a checkbox that the user can click, which will open another PDF form for them. I put the code below as a javascript action on the checkbox. It works for PC users, but not for Mac users.

var document = app.openDoc("/internal.location.com/mke/Group/user forms/Advertising/Site Email Request Form/Z_Blank Form/email request form.pdf");

I verified the path of the PDF that I want the checkbox action to open by using "this.path" in the debugger (Acrobat DC on a Mac). I had the "Advertising" volume mounted on the Macintosh. When I ran the "this.path" command, it returned   Advertising/Site Email Request Form/Z_Blank Form/email request form.pdf 

The above code only works on the PC not the Mac. Is it possible to get the checkbox script to work with both a PC and a Mac? What changes do I need to make? Based on the results from running "this.path" on the Mac, it looks as though the script should work as is,since the path is valid, or does it have to match exactly what this.path showed on the Mac?

Any help would be appreciated.

TOPICS
Acrobat SDK and JavaScript
971
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 23, 2017 Mar 23, 2017

You must use a DIPath that matches the platform requirement. You should be able to derive from the path property, but you certainly can't use the same DIPath on both platforms.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 23, 2017 Mar 23, 2017

Thanks for the clarification. I think the action of openine the form from a checkbox may best be left as a PC only function. I know all of our PC users have the (user forms) server mapped where the "checkbox" PDF form exists, but the Mac users do not. Making this work would probably entail adding an alert telling Mac users they need to mount the user forms volume. That and Mac users rarely use the forms, where PC users often submit forms.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 24, 2017 Mar 24, 2017

There's a better solution. You can check which platform is being used and then change the path accordingly, like this:

if (app.platform=="WIN") {

    app.openDoc(...); // enter the Windows path

} else if (app.platform=="MAC") {

    app.openDoc(...); // enter the Mac path

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 24, 2017 Mar 24, 2017

Still, it will need to be pre mounted. Mac has no automount by network reference. And no path reference independent of a known mount point. Note that the mount point can change, especially and always if a volume of the same name was mounted.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 24, 2017 Mar 24, 2017

Thanks for the help and suggestions everyone.

Test Screen Name is right, there is no guaranty the Mac user will have the volume mounted. I did employ try67's solution on the chance that some Mac users would have it mounted.

I think I may be stuck due to Acrobat Reader security, This form is saved as a Reader Enabled form that allows form filling in Acrobat Reader. When I try to run the action in Acrobat Reader on the PC, I get the message below in the Javascript Debugger.  The action does work in Acrobat Reader on the Mac.

NotAllowedError: Security settings prevent access to this property or method.

App.openDoc:2:Field chk_email:Mouse Up

Is there a way to get past this with Reader on the PC?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 24, 2017 Mar 24, 2017

I searched and found this solution.

"I went to Preferences, Enhanced Security, and DISABLED Enable Protected Mode at Startup."

Another person suggested that disabling of Protected Mode at Startup was not a useful solution, because you then run the risk of opening a malicious PDF.

Is there another (secure) way to do this, or should I abandon this idea?  I did think of using the "open file" action on the checkbox, but when you use that, it utilizes the mapped letter of the server, which may be different for all users.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 24, 2017 Mar 24, 2017

Protected mode, among other things, blocks all access to almost all files. But there is an exclusion list. That would have to be set up on each system.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 24, 2017 Mar 24, 2017

Sounds like I should rephrase my question to: "Is there a secure way to place a clickable link on one PDF form to open a second PDF form without having to make changes to the users' desktops?"

If the solutions involve reducing security, or the touching of individual workstations to add exclusion lists, or to add folder level scripts to each workstation (another potential solution that I came across online), then I think I will not be adding a link to my form. The team that manages the desktop computers would not be enthusiastic, or even non-committal supporters of any additional installations on users' PCs.

I wanted to place the link on the form as a convenience, so that if the user was about to start filling out the wrong form, all they had to do was click a button and open the correct form without having to manually retrieve it. If it turns out to be just a warning message instead of a link, well, then as a previous supervisor used to like to say, "It is what it is".

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 24, 2017 Mar 24, 2017

You'd be better off posting the PDF files to an internal web server and then creating simple web links that use http. As long as the two PDF files are in the same domain, you won't get the warning.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 24, 2017 Mar 24, 2017
LATEST

Joel - your suggestion is probably the way I am going to go. I would rather have the form work "stock" rather than require modifications. Thanks for the suggestion.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines