Service operations that
return a PDF document (or other data types such as XML data) as
an output value return a com.adobe.idp.Document object.
After you receive a com.adobe.idp.Document object,
you can convert it to the following formats:
The following line of code converts a com.adobe.idp.Document object
to a java.io.InputStream object. Assume that myPDFDocument represents
a com.adobe.idp.Document object:
java.io.InputStream resultStream = myDocument.getInputStream();
Likewise, you can copy the contents of a com.adobe.idp.Document to
a local file by performing the following tasks:
Create a java.io.File object.
Invoke the com.adobe.idp.Document object’s copyToFile method and
pass the java.io.File object.
The following code example
copies the contents of a com.adobe.idp.Document object
to a file named AnotherMap.pdf.
Copying the contents of a document object to a fileFile outFile = new File("C:\\AnotherMap.pdf");
myDocument.copyToFile (outFile);
|
|
|