Skip to main content
September 13, 2016
Question

using external object

  • September 13, 2016
  • 10 replies
  • 2321 views

hi,

i want to use external object from the form javascript (something like CreateObject).

is it possible?

This topic has been closed for replies.

10 replies

Legend
September 20, 2016

You can submit the form to a web server in FDF or XFDF format. The server can process and return an FDF or XFDF response. This response is used to fill form fields.

Legend
September 19, 2016

Ok bad news

1. Form rights require a very expensive enterprise solution called LiveCycle Reader Extensions. Unless your budget is in a healthy 5 figures with a spare server and Java admin, this might as well say "not in Reader".

2. If this was the only obstacle, you'd use a trusted function and startup script installed on each client.

September 20, 2016

thanks for all the answers.

my goal is to communicate with another program.

i need to send data to the program and receive answers from the program.

the program have a SQL Database and can help the user to fill some of the fields in the form with data from the database.

my first thought was using com object but i was answered that i cant do that.

after that i thought on using HTTP GET but again, there are security problems with that.

is there any other way to accomplish what i need?

any idea how to communicate with other program?

Legend
September 19, 2016

The meaning of the Quick Bars is described in the same manual. Check All boxes. If you find something in the definition that you don't understand, please let us know, there are some surprising conditions.

September 19, 2016

the boxes sayes:

1. F :Requires forms rights

2. S - For security reasons, this property or method may be available only during certain events. These events include batch processing, application start, or execution within the console. (See the event object for details of the Acrobat events.)

i need to execute the Net.HTTP.request from a button in the form.

i dont understand :

1.what is form rights.

2. can i use Net.HTTP.request from a button?

Legend
September 19, 2016

The quick bar is a box at the top of each method description. You need to check it for every method you plan to use.

September 19, 2016

hi,

on Net.HTTP.request it has S tag.

does it mean i cant use it in acrobat reader?

Legend
September 19, 2016

Ok, as I suspected. Now, have you checked the Quick Bar and security notes for reasons to fail?

September 19, 2016

how do i check that?

Bernd Alheit
Community Expert
Community Expert
September 19, 2016

Read the documentation in the Acrobat JavaScript Reference.

Legend
September 19, 2016

What does it say in the JavaScript console when it FAILS, in Reader?  This is fundamental, always check for errors. Also, did you check the security notes and Quick Bar in the JS API?

September 19, 2016

NotAllowedError: Security settings prevent access to this property or method.

Net.HTTP.request:21:Console undefined:Exec

Legend
September 19, 2016

What are tour symptoms when you move the file? Please copy/paste from JavaScript consoke if applicable.

September 19, 2016

there are no real symptoms, the code just don't work.

i have read about it a little bit and found that i need to put the code in folder level.

i did that and still the "Net.HTTP.request(params)" doesn't work.

September 19, 2016

when i put the code in the javascript console, it works.

when i try to use it in acrobat reader, its not working.

the code from the console is:

cURL = "http://www.od.co.il/smartupdate/smartupdateservice.svc/web/time";

var params =

{

   cVerb: "GET",

   cURL: cURL,

   oHandler:

   {

     response: function(msg, uri, err)

     {

         var stream = msg;

         var string = "";

         string = SOAP.stringFromStream( stream );

         app.alert(string);

     }

   }

};

Net.HTTP.request(params);

Legend
September 14, 2016

And if not, check the JavaScript console for error messages.

September 15, 2016

the code below worked for me.

thanks for the answers.

GetURLText(url);

function GetURLText (cURL)

{

var params =

{

   cVerb: "GET",

   cURL: cURL,

   oHandler:

   {

     response: function(msg, uri, err)

     {

         var stream = msg;

         var string = "";

         string = SOAP.stringFromStream( stream );

         app.alert(string);

     }

   }

};

Net.HTTP.request(params);

}

September 19, 2016

now i have a new problem.

when i move the file to a new location the code is not working.

i think it has to do with security.

any ideas how to fix this?

the script is supposed to run from a script that is written in a button action.

Legend
September 13, 2016

What sort of object? Database entity? File? COM component? PDF XObject? Something else?

September 13, 2016

Com Object

Bernd Alheit
Community Expert
Community Expert
September 13, 2016

Not possible with Acrobat JavaScript. You can create it with a plug-in (written in C/C++).

Bernd Alheit
Community Expert
Community Expert
September 13, 2016

What want you create?

September 13, 2016

object that i created.

Bernd Alheit
Community Expert
Community Expert
September 13, 2016

So the object is already created?