These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

sending files to webservice using javascript

khaledsobhy83
Registered: Mar 18 2011
Posts: 4

sending data to a web service in adobe x is very slow below is a sample code
 
stringReaded = stream.read(bound);
if (pdfDetails == null) {
parameter.jsonPdf = '{"FileName":"' + fileName + '","EncodedData":"' + stringReaded + '","UserId":"' + userNameDialog.username + '"}';
 
service.SavePdf(parameter);
 
it work very fine with adobe 9, while it is very slow with 10,
hope if any one can help

khaled

My Product Information:
Acrobat Pro 10.0, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
I have several scripts that ran just fine in Acrobat 8 and 9 that got dog slow in Acrobat X. The thing they all have in common is large data and/or long loops. This may get better and it may not. So you're probably better off in the long run using a different mechanism to send the file. I personally wouldn't trust the future of SOAP in Acrobat anyway.

You can avoid any kind of large data handling in JavaScript by using the "Submit File Attachment" mechanism built into Acrobat Forms. Look up the "field.fileSelect" property in the Acrobat JavaScript Reference. When this property is set the value of the field is expected to be a local file path. Then when the form is submitted as FDF, the referenced file is embedded in the submitted FDF. You'll need a server script on the other end that can parse out the file data.

There are other mechanism for getting Acrobat to submit file data, but they all involve actually handling the file data in a script. This one just points Acrobat to the file location and lets it do the data handling.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script