Skip to main content
September 13, 2016
Question

using external object

hi,

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

is it possible?

This topic is closed to new replies. Start a new post to keep the conversation going.

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

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

Translate
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?

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

Translate
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?

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

Translate
September 19, 2016

hi,

on Net.HTTP.request it has S tag.

does it mean i cant use it in acrobat reader?

Translate
Legend
September 19, 2016

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

Translate
September 19, 2016

how do i check that?

Translate
Bernd Alheit
Community Expert
Community Expert
September 19, 2016

Read the documentation in the Acrobat JavaScript Reference.

Translate
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?

Translate
September 19, 2016

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

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

Translate
Legend
September 19, 2016

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

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

Translate
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);

Translate
Legend
September 14, 2016

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

Translate
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);

}

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

Translate
Legend
September 13, 2016

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

Translate
September 13, 2016

Com Object

Translate
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++).

Translate
Bernd Alheit
Community Expert
Community Expert
September 13, 2016

What want you create?

Translate
September 13, 2016

object that i created.

Translate
Bernd Alheit
Community Expert
Community Expert
September 13, 2016

So the object is already created?

Translate