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

How to send a pdf to a webservice?

FranBCN
Registered: May 4 2008
Posts: 19

My idea is to attach the object form itself and

1* retrieve own object form and attach it with a name
2* retrieve attached document and code with base64 (var dEncode = SOAP.streamEncode(strean, "base64"))
3* put the result value into a string variable (var str = SOAP.stringFromStrean(dEncode))
4* call webservice passing this string as parameter

What i dont know how to do it is with point 1. Any ideas? I dont want to save the self document to disk. Thank u!

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
There is a way to do #1 on your list. But it's undocumented and likely to change. This method is also problematic because PDF files often exceed the maximum object size in JavaScript.

There is a much, much easier and more reliable way to do this. Don't use a web service. Use the submitForm() function in Acrobat JavaScript to send the entire PDF to a server side script. This is a robust and standard methodology for transfering a PDF to a server.

From a LiveCycle document you'd use code something like this

event.target.submitForm({cURL: ... , cSubmitAs:"PDF"});

The form will need "Save" Rights to work from Reader.

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