Skip to main content
Sep 13, 2016 8:24 AM UTC
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
Sep 20, 2016 8:12 AM UTC

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
Sep 19, 2016 12:01 PM UTC

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
Sep 20, 2016 4:35 AM UTC

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
Sep 19, 2016 10:55 AM UTC

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
Sep 19, 2016 11:05 AM UTC

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
Sep 19, 2016 10:08 AM UTC

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
Sep 19, 2016 10:24 AM UTC

hi,

on Net.HTTP.request it has S tag.

does it mean i cant use it in acrobat reader?

Translate
Legend
Sep 19, 2016 8:45 AM UTC

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

Translate
Sep 19, 2016 8:47 AM UTC

how do i check that?

Translate
Bernd Alheit
Community Expert
Community Expert
Sep 19, 2016 8:51 AM UTC

Read the documentation in the Acrobat JavaScript Reference.

Translate
Legend
Sep 19, 2016 8:28 AM UTC

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
Sep 19, 2016 8:41 AM UTC

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

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

Translate
Legend
Sep 19, 2016 7:13 AM UTC

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

Translate
Sep 19, 2016 7:51 AM UTC

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
Sep 19, 2016 8:14 AM UTC

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
Sep 14, 2016 3:38 PM UTC

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

Translate
Sep 15, 2016 4:44 AM UTC

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
Sep 19, 2016 5:43 AM UTC

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
Sep 13, 2016 10:10 AM UTC

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

Translate
Sep 13, 2016 10:21 AM UTC

Com Object

Translate
Bernd Alheit
Community Expert
Community Expert
Sep 13, 2016 10:24 AM UTC

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

Translate
Bernd Alheit
Community Expert
Community Expert
Sep 13, 2016 9:05 AM UTC

What want you create?

Translate
Sep 13, 2016 10:02 AM UTC

object that i created.

Translate
Bernd Alheit
Community Expert
Community Expert
Sep 13, 2016 10:06 AM UTC

So the object is already created?

Translate