Skip to main content
Participant
August 10, 2025
Question

Need help with HTTP Calls in Adobe Reader

  • August 10, 2025
  • 1 reply
  • 279 views

Here is what I want to do:
I want to Do HTTP Get Calls and HTTP Post Calls From my PDF and Im facing the issue where it says
Request error: NotAllowedError: Security settings prevent access to this property or method.

My privilaged function:
~/Library/Application\ Support/Adobe/Acrobat/DC/JavaScripts/trustedNet.js

var trustedNetRequest = app.trustedFunction(function(cURL) {
    app.beginPriv();
    try {
        Net.HTTP.request({
            cURL: cURL,
            cMethod: "GET",
            oHandler: {
                response: function(msg) {
                    console.println("Response: " + msg);
                    app.alert("API Response: " + msg);
                },
                error: function(e) {
                    console.println("Error: " + e);
                    app.alert("Error: " + e);
                }
            }
        });
    } catch (e) {
        console.println("Request error: " + e);
        app.alert("Request error: " + e);
    }
    app.endPriv();
});


In PDF:

function testAPI() {
    try {
        trustedNetRequest("https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd");
    } catch (e) {
        app.alert("Unable to call privileged function: " + e);
    }
}


I tried it with folder-level privileged javascript function, with all Enhanced security off and I still get this error. Need help asap.Thanks!

1 reply

Thom Parker
Community Expert
Community Expert
August 10, 2025

Notice that in the reference entry for the Net.HTTP.request function that the "Product field on the Rights bar" is set to "F".  This means the PDF requires  form rights in addition to privilege. Form Rights is unfortunately a broad category. There are several form rights. Like form filling, which is given automatically. But form rights for HTTP access is a different thing. It's not free. 

 

Your best way around this restriction is to use a regular form submit to a PHP (or other) sever script, which then makes the HTTP call you want, and then returns the result to a hidden form field.  This however is still a privileged operation that will be blocked until the user approves the operation.  

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Participant
August 11, 2025

How can I get the response, because form submission seems to be a one way proccess 

 

Thom Parker
Community Expert
Community Expert
August 11, 2025

All HTTP operations are a handshake. Form submission is a specialized case, but it is still a handshake. Quite literally it is either an HTTP Get or Put. Only the submission follows a specific format.  It's all outlined in the reference.

I'd be happy to provide you with custom help for a fee. PM me on this forum. 

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often