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

Need help with HTTP Calls in Adobe Reader

New Here ,
Aug 10, 2025 Aug 10, 2025

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!

TOPICS
Create PDFs , How to , JavaScript , Modern Acrobat , PDF , PDF forms
149
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 ,
Aug 10, 2025 Aug 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 PDFScripting
Use the Acrobat JavaScript Reference early and often

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
New Here ,
Aug 10, 2025 Aug 10, 2025

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

 

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 ,
Aug 11, 2025 Aug 11, 2025
LATEST

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 PDFScripting
Use the Acrobat JavaScript Reference early and often

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