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

using external object

Guest
Sep 13, 2016 Sep 13, 2016

hi,

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

is it possible?

TOPICS
Acrobat SDK and JavaScript , Windows
2.0K
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 ,
Sep 13, 2016 Sep 13, 2016

What want you create?

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
Guest
Sep 13, 2016 Sep 13, 2016

object that i created.

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 ,
Sep 13, 2016 Sep 13, 2016

So the object is already created?

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
Guest
Sep 13, 2016 Sep 13, 2016

the object is mine.

i want to know how to use it with the javascript.

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 ,
Sep 13, 2016 Sep 13, 2016

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

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
Guest
Sep 13, 2016 Sep 13, 2016

Com Object

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 ,
Sep 13, 2016 Sep 13, 2016

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

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
Guest
Sep 14, 2016 Sep 14, 2016

can i call to specific url and get answer from the url?

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

Look for SOAP in the Acrobat JavaScript Reference.

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
Guest
Sep 14, 2016 Sep 14, 2016

hi,

what am i doing wrong in this script?

im trying to show the string that i get from the URL.

GetURLText("http://www.od.co.il/smartupdate/smartupdateservice.svc/web/time");

function GetURLText (cURL)

{

var params =

{

   cVerb: "GET",

   cURL: cURL,

   oHandler:

   {

     response: function(msg, uri, err)

     {

       app.alert(msg);

     }

   }

};

Net.HTTP.request(params);

}

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

I think it works... Just change this line:

app.alert(msg);

To:

app.alert(msg.read());

And you'll see the actual value of the ReadStream variable...

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

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

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
Guest
Sep 14, 2016 Sep 14, 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
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
Guest
Sep 18, 2016 Sep 18, 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
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 ,
Sep 19, 2016 Sep 19, 2016

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

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
Guest
Sep 19, 2016 Sep 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
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
Guest
Sep 19, 2016 Sep 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
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 ,
Sep 19, 2016 Sep 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
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
Guest
Sep 19, 2016 Sep 19, 2016

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

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

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 ,
Sep 19, 2016 Sep 19, 2016

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

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
Guest
Sep 19, 2016 Sep 19, 2016

how do i check that?

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 ,
Sep 19, 2016 Sep 19, 2016

Read the documentation in the Acrobat JavaScript Reference.

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 ,
Sep 19, 2016 Sep 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
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
Guest
Sep 19, 2016 Sep 19, 2016

hi,

on Net.HTTP.request it has S tag.

does it mean i cant use it in 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