Copy link to clipboard
Copied
Hi, I'm trying to send a GET request with Net.HTTP.request to http://dummy.restapiexample.com/ , actually I'm calling this endpoint: http://dummy.restapiexample.com/api/v1/employee/7052
No matter what I try I always get this error:
NotAllowedError: Security settings prevent access to this property or method.
It's a js which is being called at document level, improved security is disabled and I've also tried enabling it.
the code is -->
//<Document-Level>
//<ACRO_source>Init</ACRO_source>
//<ACRO_script>
/**** pertenece a: Document-Level:Init ****/
myTrustedFunction = app.trustedFunction(
function()
{
this.getField("textAJAX").display = display.hidden;
console.println("2 - ");
Net.HTTP.request({
cVerb: 'GET',
cURL: 'http://dummy.restapiexample.com/api/v1/employee/7052',
oHandler: {
response: function(msg, uri, err) {
if (err != undefined) {
app.alert(msg)
} else {
console.println("1");
var stream = msg;
console.println(stream);
};
}
}
});
}
);
//</ACRO_script>
Copy link to clipboard
Copied
This is a privileged operation. If you want to run it from a document script, then the document has to be trusted. You can do this by marking it as trusted in the "Enhanced Security" Preference, or by digitally certifying it with scripting privileges. Otherwise it has to be done from a trusted function in a folder level script.
Copy link to clipboard
Copied
Thx, in acrobat is working.
But it doesn't work in Adobe Reader.
The steps were:
"You can do this by marking it as trusted in the "Enhanced Security" Preference"
Code:
myTrustedFunction = app.trustedFunction(
function()
{
var drop= this.getField("dropEmp");
drop.setItems(new Array([]));
var employee=[["",""]];
app.alert("Reader");
Net.HTTP.request({
cVerb: 'GET',
cURL: 'http://dummy.restapiexample.com/api/v1/employees',
oHandler: {
response: function(msg, uri, err) {
if (err != undefined) {
app.alert(msg)
} else {
var stream = msg;
console.println(msg);
var string = SOAP.stringFromStream( stream );
var json= JSON.parse(string);
for (var i = 0; i < 5; i++) {
employee.push(
[
json.id.toString(),
json.id.toString()
]);
}
drop.setItems(employee);
};
}
}
});
}
);
myTrustedFunction();
Copy link to clipboard
Copied
You need special forms rights for the use in Acrobat Reader.
Copy link to clipboard
Copied
Ok, sample? documentation?
I'm a new user.
Copy link to clipboard
Copied
In the past it was possible with the product Adobe LiveCycle Reader Extensions. Now it is part of AEM Forms.
Copy link to clipboard
Copied
Funciones de AEM | Adobe Experience Manager ?
it isn't possible with Adobe Acrobat forms?
Copy link to clipboard
Copied
The reader extensions can be applied to Acrobat forms.
Copy link to clipboard
Copied
Ok, how?
how do I apply the extension?
I don't know
Copy link to clipboard
Copied
Do you own AEM?
Copy link to clipboard
Copied
I only use Adobe Acrobat Pro Dc and Adobe Reader (used by end user)
Copy link to clipboard
Copied
It is not possible with Adobe Acrobat.
Copy link to clipboard
Copied
Forgetting about AEM.
In a created form in Adobe Acrobat, it is impossible to use Net.HTTP.request in Adobe Reader?
Copy link to clipboard
Copied
You can use it in Reader when you apply the special form rights to the form!
Copy link to clipboard
Copied
And how can we do that? Do you know about any documentation explaining the steps to do that?
Thanks
Copy link to clipboard
Copied
May be that you can find the information in the documentation of AEM Forms.
Copy link to clipboard
Copied
We are not using AEM Forms and we cannot use them. We are creating the form using Adobe Acrobat Pro, in which the Net.HTTP.request() call works perfectly, but when we open the form with Adobe Reader this call doesn't work. We have tried to save the form with the following option but it doesn't work neither:
Any clue about next steps? Thanks!
Copy link to clipboard
Copied
Read my replies.
Copy link to clipboard
Copied
Are you talking about this replies? As I told you we are not using AEM forms and we cannot use them:
Copy link to clipboard
Copied
I mean this software:
Copy link to clipboard
Copied
There are many different "Rights" or "Reader Extensions" that can be added to a PDF that will allow it to do all kinds of things in Reader. These "Rights" are basically digital certificates. Some of the most basic "Rights" can be applied with Acrobat Pro. But there are many more, and these requires a special server and have to be purchased (Note: can be insanely expensive). Over the years the name of this server, and exact names and granularity of the rights have changed. These days it's part of the AEM servers. This has nothing to do with AEM forms, its just part of that thing now.
Copy link to clipboard
Copied
To put it another way, you CANNOT do this in Reader unless you have a budget in the many tens of thousands of dollars. So, instead, you need to buy Acrobat for every single user. That is your choice.
Copy link to clipboard
Copied
You must use the trusted function in a folder level file.