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

Making HTTP request in the PDF

Community Beginner ,
Jun 07, 2021 Jun 07, 2021

Copy link to clipboard

Copied

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.

 

TOPICS
Create PDFs , JavaScript

Views

6.2K

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Expert , Jun 07, 2021 Jun 07, 2021

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

 

Votes

Translate

Translate
Community Expert ,
Jun 07, 2021 Jun 07, 2021

Copy link to clipboard

Copied

Use a trusted function for this.

Votes

Translate

Translate

Report

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 Beginner ,
Jun 07, 2021 Jun 07, 2021

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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 ,
Jun 07, 2021 Jun 07, 2021

Copy link to clipboard

Copied

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

Look also at Acrobat Javascript Reference.

Votes

Translate

Translate

Report

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 Beginner ,
Jun 07, 2021 Jun 07, 2021

Copy link to clipboard

Copied

Thanks a lot 

 

But it only works on startup (folder level script ) not on button click, still giving me the same error message.

The documentation says that it can work on "trusted documents" .

How can i make my document trusted ? i really searched a lot and haven't find any.

Votes

Translate

Translate

Report

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 ,
Jun 07, 2021 Jun 07, 2021

Copy link to clipboard

Copied

Have you created a trusted function? And does you use this function at the button?

Votes

Translate

Translate

Report

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 Beginner ,
Jun 07, 2021 Jun 07, 2021

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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 ,
Jun 07, 2021 Jun 07, 2021

Copy link to clipboard

Copied

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

 

Votes

Translate

Translate

Report

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 Beginner ,
Jun 08, 2021 Jun 08, 2021

Copy link to clipboard

Copied

Thanks a lot Bernd,I really appreciate your help and support.

 

Yes this works as well, it's very unfortunate though that there is no way that the document itself can't have trusted functions without depending on folder level scripts.

Votes

Translate

Translate

Report

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 ,
Jun 08, 2021 Jun 08, 2021

Copy link to clipboard

Copied

Trusted functions in the document makes no sense.

For security reason trusted functions must be defined at folder level.

Votes

Translate

Translate

Report

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 Beginner ,
Jun 08, 2021 Jun 08, 2021

Copy link to clipboard

Copied

I have one followup question...could this application not even work on google docs then?

Votes

Translate

Translate

Report

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 ,
Jun 08, 2021 Jun 08, 2021

Copy link to clipboard

Copied

Try a forum for Google Docs.

Votes

Translate

Translate

Report

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 Beginner ,
Jun 08, 2021 Jun 08, 2021

Copy link to clipboard

Copied

the problem would be with adobe not google docs...but if you say it is a file level...it should work right?

 

Votes

Translate

Translate

Report

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 ,
Jun 08, 2021 Jun 08, 2021

Copy link to clipboard

Copied

What is the problem?

Votes

Translate

Translate

Report

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 Beginner ,
Jun 08, 2021 Jun 08, 2021

Copy link to clipboard

Copied

please read above...when I say "problem" I mean the restraint is with adobe.  You say that trusted documents must be on a file level.  So I am asking if we can use google docs then for those files....it is a file/folder level.

 

Votes

Translate

Translate

Report

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 ,
Jun 08, 2021 Jun 08, 2021

Copy link to clipboard

Copied

No. You must use a js-file at one of the two Javascript folders. 

Votes

Translate

Translate

Report

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 ,
Mar 08, 2023 Mar 08, 2023

Copy link to clipboard

Copied

Hi Bernd. I'm in the same situation than Joanna. I've read numbers post over internet and i cant make Net.HTTP.request works on acrobat reader (11 or dc). Allways "NotAllowedError" error. The code is in Config.js in acrobat javascript folder, and attach to a menu.

It works well on PRO but not on Reader. Do you have an idea ???

My goal was to send the PDF modified by user on a http server.

 

Thanks

Votes

Translate

Translate

Report

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
LEGEND ,
Mar 08, 2023 Mar 08, 2023

Copy link to clipboard

Copied

Do NOT edit config.js. Restore it exactly and then create a new startup JS file in the user startup folder. But that won't make it work in Pro. The quick bart shows an F in box 4, meaning you need "forms rights". These can ONLY be granted by AEM software, POA, expect 5-6 figure license fees. Generally it will be cheaper to license Acrobat for each user, or give up on the idea of using this method. Consider using the existing SUBMIT mechanism, which is available in Reader and without startup scripts.

Votes

Translate

Translate

Report

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 ,
Mar 08, 2023 Mar 08, 2023

Copy link to clipboard

Copied

I can make it work with "submitform" but my goal is to make it transparent for users. If i use "submitform" i alwways have to click on a message box (status variable). I just want that users click on a button and nothing else.

I think adobe has "blocked" Net.HTTP.request on READER to make user buy Pro version

 

Thanks for your help

Votes

Translate

Translate

Report

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
LEGEND ,
Mar 08, 2023 Mar 08, 2023

Copy link to clipboard

Copied

LATEST

"I think adobe has "blocked" Net.HTTP.request on READER to make user buy Pro version"

Yes, of course. That's why Reader exists - to create an appetite for paid-for features. Adobe's aim is to sell it everyone, not just creators. But, for the price of a few hundred licenses, AEM enabling is an alternative for a very few paths. 

Votes

Translate

Translate

Report

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