Copy link to clipboard
Copied
I am trying to send a document to a SaaS. The documentation for the Net.Http.request function indicates that you can just call it
like a normal function so after reading documentation and trying to build a proof of concept based on it, I got the following error:
"NotAllowedError: Security settings prevent access to this property or method."
What are the specific set of steps involved in order to allow a javascript call to the Net.Http.request method?
Copy link to clipboard
Copied
What documentation are you referring to? That isn’t a standard Acrobat JS method…
Copy link to clipboard
Copied
http://help.adobe.com/livedocs/acrobat_sdk/11/Acrobat11 HTML.Help/wwhelp/wwhimp/js/html/whelp.htm?href=JavaScript_SectionPage.70.1.html&accessible=true
Copy link to clipboard
Copied
Ah, found it in the document. I think you didn't check out the information in the Quick Bar and security note....
Copy link to clipboard
Copied
Thanks. We will look.
Copy link to clipboard
Copied
We looked further and now wondering, what does "forms rights" mean and how does one apply it to a specific document
using acrobat?
Copy link to clipboard
Copied
It means that you enabled special rights in your form using the Save as Rights Enabled PDF feature.
Copy link to clipboard
Copied
Please elaborate on what this means, I have never developed for adobe acrobat before.
Where can I find the documentation that explains the steps involved in applying these rights to a pdf?
I find no such "Save as Rights enabled" any where in acrobat DC Pro's menus or preferences or save as dialogs the closest I find is this:
I've tried this several different ways and I cannot get the method Net.HTTP.request to execute at all with acrobat pro or reader DC or XI in my javascript extension code.
Clearly I'm doing something wrong if it won't execute that method.
However, there must be some set of circumstances or steps on how to apply these rights I'm missing. The documentation isn't very clear on this particular aspect.
Copy link to clipboard
Copied
You need the "form rights" only for Acrobat Reader.
Copy link to clipboard
Copied
Exactly how do you apply "form rights" ?
Copy link to clipboard
Copied
You can apply this with a server tool named LiveCycle Reader Extension.
Copy link to clipboard
Copied
So does Acrobat Pro possess this capability(Apply form rights to a document) at all ?
Copy link to clipboard
Copied
With Acrobat Pro you can apply "form save rights", not "form rights".
Copy link to clipboard
Copied
Thanks. Bernd.
I am getting the sense that it isn't possible to take a pdf document and "save" it to a SaaS through a REST API. Would you say that is true? It is not a form that I am saving its data, but I am trying to save a whole document to a cloud storage.
Copy link to clipboard
Copied
I know nothing about this API.
Copy link to clipboard
Copied
I would say not. To work with PDF files you can't usually use existing web APIs, you have to create ones for the format. You can SUBMIT a form to a web URL, which is a way to achieve sending. Don't expect it to work in most browsers though.
Copy link to clipboard
Copied
Is there a way from a javascript extension script to submit the entire pdf file (I'm thinking a byte[] - meaning the entire set of bytes that make up the pdf) to another process on the same machine or post to a server(form submit)?
I've explored the "save"/"Save As" route as described here: https://acrobatusers.com/tutorials/how-save-pdf-acrobat-javascript
That won't work, I need a way to grab the entire byte contents of the file and submit it from a javascript extension script running in acrobat. The end goal being to post to a form url or a RESTful Api interface.
The whole reason this forum post was started was I discovered through trial and error and javascript api documentation that I couldn't use the Net.HTTP.request (discussed above) without specific rights to the document (also discussed previously) and a priviledged context.
I would like to know if it is possible within a javascript extension script, if the script can grab the file itself as a binary/byte[](note that this is not the form with in the file but the entire file) in order to send the bytes to another process or server.
Copy link to clipboard
Copied
The normal submit action in Acrobat and now Reader can submit the entire file to a server, you don't need any special permissions. The only thing that's a bit odd is that the PDF is the body of the message, there's no multipart anything. You then just write the bytes to disk and you have a PDF on your server or you can ship it off to other RESTful APIs.
If you need to communicate back to the PDF, you do that via FDF or XFDF. Most RESTful APIs don't return FDF or XFDF so you'll need to massage the response into something Acrobat will like and send that back. It's far easier than it sounds, just think of your server as an intermediary between the PDF and the API you want to leverage and you can basically do whatever you want without needing to add Reader Extensions.
Copy link to clipboard
Copied
That's the first helpful answer I've seen here. Thanks. I'm new to acrobat related anything... but I'm a senior level .net developer.
Can you point me to the right documentation about this submit function or tell me where it is in acrobat's javascript API documentation ?
Here's what I'm looking at:
http://help.adobe.com/livedocs/acrobat_sdk/11/Acrobat11_HTMLHelp/wwhelp/wwhimpl/js/html/wwhelp.htm?h...
Copy link to clipboard
Copied
Well that is exactly what I was trying to tell you, sorry you didn't find it helpful. search the docs for "submit".
Copy link to clipboard
Copied
You don't actually need to use JavaScript to submit the entire file. You can just set that up through the UI.
Go to your button properties and set the Mouse Up action to Submit and then select "PDF" under Export format. Add the fully qualified URL to your script and you're good to go.
J-
Copy link to clipboard
Copied
Here is some information about how to receive the file on the server (and how to send a status message back to the client):
Find more inspiration, events, and resources on the new Adobe Community
Explore Now