Skip to main content
Participant
October 28, 2016
Question

Net.HTTP.Request is not working on Adobe Reader

  • October 28, 2016
  • 2 replies
  • 2877 views

Hi,

I made one JS file and placed in Reader's and Acrobat's javascript folder for posting the opened PDF document to server using below code.

app.addMenuItem({ cName: "Upload Data", nPos: "Close", cParent: "File", cExec: "runExtract()" });

var runExtract = app.trustedFunction(function() {

  app.beginPriv();

    try {

        var params =

          {

            cVerb: "POST",

              cURL: "http://domain/Service/upload.ashx",

              aHeaders: [{ name: "fileName", value: this.documentFileName }],

              oRequest: Collab.documentToStream(this)

          };

        var responseStream = Net.HTTP.request(params);

        var response = SOAP.stringFromStream(responseStream);

    }

    catch (e) {

        app.alert({ cMsg: e.message, cTitle: "Exception" });

    }

  app.endPriv();

});

And the above code is working good with Adobe Acrobat Pro, but not Adobe Reader.

I found the issue with Net.HTTP.request.

Suggest me solution to resolve the issue.

Thanks in advance.

Regards,

Chandra.

This topic has been closed for replies.

2 replies

Legend
October 28, 2016

The JavaScript Reference or JavaScript API is the essential documentation all JavaScript programmers will need. Each method has a box - quick bar - showing critical information to check before use. NEVER assume methods will work in Reader without checking.

Legend
October 28, 2016

What is the console contents in Reader?

What does the Quick Bar say about availability in Reader?

RCPaluriAuthor
Participant
October 28, 2016

Hi,

Thanks for reply.

I just started working on created JS file.

The PDF is just scanned image. If I'm not wrong about console contents. If that is wrong, can I have more information regarding the console content in Reader.

Regarding What does the Quick Bar say about availability in Reader?. I'm confusing.

Thanks,

Chandra.

try67
Community Expert
Community Expert
October 28, 2016

In order to use this method in Reader a special right has to be applied to the file using one of the LiveCycle server applications by Adobe. These applications are very expensive, though.