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

what are the specific set of steps involved in order to allow a javascript call to the Net.Http.request method?

New Here ,
Dec 06, 2016 Dec 06, 2016

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?

TOPICS
Acrobat SDK and JavaScript
3.4K
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
Adobe Employee ,
Dec 06, 2016 Dec 06, 2016

What documentation are you referring to? That isn’t a standard Acrobat JS method…

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 ,
Dec 06, 2016 Dec 06, 2016

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

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
LEGEND ,
Dec 06, 2016 Dec 06, 2016

Ah, found it in the document. I think you didn't check out the information in the Quick Bar and security note....

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 ,
Dec 06, 2016 Dec 06, 2016

Thanks. We will look.

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 ,
Dec 06, 2016 Dec 06, 2016

We looked further and now wondering, what does "forms rights" mean and how does one apply it to a specific document

using acrobat?

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
Adobe Employee ,
Dec 06, 2016 Dec 06, 2016

It means that you enabled special rights in your form using the Save as Rights Enabled PDF feature.

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 ,
Dec 06, 2016 Dec 06, 2016

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:

adobe-acrobat-save-as-other.png

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.

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 ,
Dec 06, 2016 Dec 06, 2016

You need the "form rights" only for Acrobat Reader.

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 ,
Dec 06, 2016 Dec 06, 2016

Exactly how do you apply "form rights" ?

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 ,
Dec 06, 2016 Dec 06, 2016

You can apply this with a server tool named LiveCycle Reader Extension.

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 ,
Dec 06, 2016 Dec 06, 2016

So does Acrobat Pro possess this capability(Apply form rights to a document) at all ?

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 ,
Dec 06, 2016 Dec 06, 2016

With Acrobat Pro you can apply "form save rights", not "form rights".

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 ,
Dec 09, 2016 Dec 09, 2016

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.

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 ,
Dec 10, 2016 Dec 10, 2016

I know nothing about this API.

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
LEGEND ,
Dec 12, 2016 Dec 12, 2016

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.

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 ,
Dec 14, 2016 Dec 14, 2016

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.

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 ,
Dec 14, 2016 Dec 14, 2016

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.

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 ,
Dec 15, 2016 Dec 15, 2016

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...

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
LEGEND ,
Dec 16, 2016 Dec 16, 2016

Well that is exactly what I was trying to tell you, sorry you didn't find it helpful. search the docs for "submit".

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 ,
Dec 16, 2016 Dec 16, 2016

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.

submit.png

J-

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 ,
Dec 16, 2016 Dec 16, 2016
LATEST

Here is some information about how to receive the file on the server (and how to send a status message back to the client):

Submitting a form using HTML (PDF Forms)

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