Copy link to clipboard
Copied
hi,
i want to use external object from the form javascript (something like CreateObject).
is it possible?
Copy link to clipboard
Copied
What want you create?
Copy link to clipboard
Copied
object that i created.
Copy link to clipboard
Copied
So the object is already created?
Copy link to clipboard
Copied
the object is mine.
i want to know how to use it with the javascript.
Copy link to clipboard
Copied
What sort of object? Database entity? File? COM component? PDF XObject? Something else?
Copy link to clipboard
Copied
Com Object
Copy link to clipboard
Copied
Not possible with Acrobat JavaScript. You can create it with a plug-in (written in C/C++).
Copy link to clipboard
Copied
can i call to specific url and get answer from the url?
Copy link to clipboard
Copied
Look for SOAP in the Acrobat JavaScript Reference.
Copy link to clipboard
Copied
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);
}
Copy link to clipboard
Copied
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...
Copy link to clipboard
Copied
And if not, check the JavaScript console for error messages.
Copy link to clipboard
Copied
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);
}
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
What are tour symptoms when you move the file? Please copy/paste from JavaScript consoke if applicable.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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);
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
NotAllowedError: Security settings prevent access to this property or method.
Net.HTTP.request:21:Console undefined:Exec
Copy link to clipboard
Copied
Ok, as I suspected. Now, have you checked the Quick Bar and security notes for reasons to fail?
Copy link to clipboard
Copied
how do i check that?
Copy link to clipboard
Copied
Read the documentation in the Acrobat JavaScript Reference.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
hi,
on Net.HTTP.request it has S tag.
does it mean i cant use it in acrobat reader?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now