I have an API created using Django Rest.
The url is live and running on a server that I have access to.
When the url is hit
https://myurl.com/api/test?format=json
This is returned:
{"currentNumber":51,"iterativeField":"51","maxNumberOfDigitsInNum":2}
I need to access this data through an Acrobat PDF button.
I'm using Acrobat Pro. In the pdf I add a button.
The button trigger is 'Mouse Up'.
The Action is 'Run a JavaScript'.
The JavaScript itself is:
var tempVar = getURL("https://myurl.com/api/test?format=json", "_blank", "GET");
The error I'm getting is:
NotAllowedError: Security settings prevent access to this property or method.
Doc.getURL:1:Field Button1:Mouse Up
I checked the security on the PDF and there is 'no security'. Everything is allowed.
I am not sure how to proceed. Where do I need to set up this security?
Acrobat does have JavaScript but it's own version, 'Acrobat JavaScript'; and it has limitations. It does not have all the functionality as HTML JavaScript. Attempting to access a url outside of the pdf does not work using Acrobat JavaScript. The work around was to pull the data from the API using urllib, then create another pdf and squish the two PDFs together. I was able to do this using Python/Django.