Skip to main content
Participating Frequently
June 7, 2021
Answered

Making HTTP request in the PDF

  • June 7, 2021
  • 1 reply
  • 9756 views

Hello there, 

 

I am trying to make a pdf button where i can click on it , retrieve the data from the server , fill a dropdown list from there.

The code : 

Net.HTTP.request({
cVerb: "GET",
cURL: "http://newits.devs/getContacts.php",
oHandler:{
response: function(msg,uri,e,h){
    app.alert(msg);
}
}
});


But i am getting an error after i click it : 

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

 

This topic has been closed for replies.
Correct answer Bernd Alheit

I did create the trusted function and put it on the action when the button clicks , but it still gives me 

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

it works fine though as a folder level script


At folder level you must define the function. At the button use / call the function.

 

1 reply

Bernd Alheit
Community Expert
Community Expert
June 7, 2021

Use a trusted function for this.

Participating Frequently
June 7, 2021

Can you please direct me to a resource on how to use it ? 
Or Maybe you can tell me what should i add in the above code so it's using a trusted function ? 

Thanks in advance.

Bernd Alheit
Community Expert
Community Expert
June 7, 2021

https://acrobatusers.com/tutorials/using_trusted_functions/ 

Look also at Acrobat Javascript Reference.