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

Reader (but acrobat has no issue) gets notallowed error on app.launchUrl usage

Guest
Jun 14, 2017 Jun 14, 2017

usage occurs on button press, app.launchurl is inside a trusted js file in the javascript folder of reader dc

how do i get reader to be cool? i'm just trying to get gmail and gcal to pop up

Everything i looked at saying it only works in batch and console but i don't understand why it would work in acrobat versus reader. Is reader not allowed to app.launchurl? Any help would be greatly appreciated.

TOPICS
Acrobat SDK and JavaScript , Windows
1.2K
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 ,
Jun 14, 2017 Jun 14, 2017

Can you post the code of the trusted function?

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
Guest
Jun 15, 2017 Jun 15, 2017

var openGmail = app.trustedFunction(

    function (stringUrl){

        app.beginPriv();    // Explicitly raise privilege

  app.launchURL(stringUrl,true);

  app.endPriv();

});

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 ,
Jun 15, 2017 Jun 15, 2017

What is your goal exactly? Gmail is one of the web-based email systems that Acrobat/Reader natively support. You may be able to get away with mailto: links.

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
Guest
Jun 15, 2017 Jun 15, 2017

well rather than attach a pdf with an order on it i thought it might be cooler to send that order in the body of an email so that the person taking the order wouldn't have to open the attachment. Regardless though i really need app.launchurl to work because we also use google calendar to schedule appointments and i want to automatically create the calendar event on the close of the pdf or a button press which can be done (well you still have to click save) by generating and accessing a custom google calendar url which i would need to calculate using javascript.

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 ,
Jun 15, 2017 Jun 15, 2017

As I wrote, launchURL doesn't require a trusted function.

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
Guest
Jun 15, 2017 Jun 15, 2017

i originally tried without trusted function - heck i only found out about them a couple days ago - but i got the same deal happening. Though for some reason acrobat has no problem with opening the url. I just figured that was because it had more permissions or something.

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 ,
Jun 15, 2017 Jun 15, 2017

On Zoho mail.. Maybe.

The user needs to have set up their copy of Reader/Acrobat to work with their preferred email client. The viewers natively support Gmail and Yahoo mail... for some reason... but you can configure any hosted service using advanced settings. It may or may not work though.

Honestly though, you are really better off submitting the form data to a server that then generates the email. You're going to run into problems if you assume the local version of Reader/Acrobat is set up to handle doing the email itself or launch a URL properly.

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
Guest
Jun 15, 2017 Jun 15, 2017

i do plan to ensure if necessary that everybody's reader is set up to handle the javascript that opens urls. It's not the email really that concerns me though but the fact that despite me doing a trusted function i can't get the app.launchurl to work in anything but acrobat. I saw that there might be some methods that simply don't work in reader no matter what you do - I just couldn't find confirmation that app.launchurl was one of them.

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 ,
Jun 15, 2017 Jun 15, 2017

You might also want to check the Enhanced Security settings in Reader's Preferences. It is possible that Windows or an OS's security settings and blocked web sites could be coming into play here.

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
Guest
Jun 15, 2017 Jun 15, 2017

Originally the check boxes for both "enable enhanced security" and "enable protected mode at startup" were both checked. I also tried adding the javascripts folder to the trusted location section.

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 ,
Jun 15, 2017 Jun 15, 2017
LATEST

What happens when you use only app.launchURL("https://mail.google.com",true); ?

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 ,
Jun 15, 2017 Jun 15, 2017

Can you post the full code, not just of the trusted function, but also in your file?

What error message are you getting in Reader?

Actually, launchURL does not require a trusted context at all, so this is very odd...

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
Guest
Jun 15, 2017 Jun 15, 2017

sorry didn't see your post makes sense to post it all - thanks for the quick replies

// FOR BUTTON MOUSE UP EVENT JAVASCRIPT

var list = this.getField("orderList");

var shop = this.getField("SHOP NAME").value;

var ALL = "";

var subject = "&su=Draeger+Supply+Order+for+"+shop;

var basicUrl = "https://mail.google.com/mail/u/0/?view=cm&fs=1";

var emailto = "&to=workemail@mywork.com";

var body = "&body=";

for(var i = 0; i <list.numItems; i++)

{

    body+=list.getItemAt(i,false)+"%0a";

}

ALL+=basicUrl+subject+emailto+body;

openGmail(ALL);

//trusted function: openGmail -  definition

var openGmail = app.trustedFunction(

    function (stringUrl){

        app.beginPriv();    // Explicitly raise privilege

  app.launchURL(stringUrl,true);

  app.endPriv();

});

//error message received while trying to use button in adobe reader dc

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

Doc.subject:5:Field SEND WITH GMAIL:Mouse Up

//results from button use in adobe acrobat Xi

well it opens the tab and a new gmail is ready to compose

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 ,
Jun 15, 2017 Jun 15, 2017

In that case, just use the mailDoc method of doc. Assuming Gmail is the default mail application, you'll get the gmail UI opened in a browser.

Acrobat DC SDK Documentation

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
Guest
Jun 15, 2017 Jun 15, 2017

do you think this would work with zoho mail too?

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