Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Can you post the code of the trusted function?
Copy link to clipboard
Copied
var openGmail = app.trustedFunction(
function (stringUrl){
app.beginPriv(); // Explicitly raise privilege
app.launchURL(stringUrl,true);
app.endPriv();
});
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
As I wrote, launchURL doesn't require a trusted function.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied

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.
Copy link to clipboard
Copied
What happens when you use only app.launchURL("https://mail.google.com",true); ?
Copy link to clipboard
Copied
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...
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
do you think this would work with zoho mail too?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now