Take a survey

Developing Applications Using APIs > Creating Document Output Streams > Creating PDF/A Documents > Creating a PDF/A document using the web service API

Creating a PDF/A document using the web service API
To create a PDF/A document using the Output web service API, perform the following tasks:
1.
2.
Using the Microsoft .NET client assembly, create an OutputServiceService object by invoking its default constructor.
3.
Create a BLOB object by using its constructor. The BLOB object is used to store data that will be merged with the PDF/A document.
Create a System.IO.FileStream object by invoking its constructor and passing a string value that represents the file location of the PDF document to encrypt and the mode in which to open the file.
Create a byte array that stores the content of the System.IO.FileStream object. You can determine the size of the byte array by getting the System.IO.FileStream object’s Length property.
Populate the byte array with stream data by invoking the System.IO.FileStream object’s Read method and passing the byte array, the starting position, and the stream length to read.
Populate the BLOB object by assigning its binaryData property with the contents of the byte array.
4.
Create a PDFOutputOptionsSpec object by using its constructor.
Set the File URI option by assigning a string value that specifies the location of the PDF file that the Output service generates to the PDFOutputOptionsSpec object’s fileURI data member.
5.
Create a RenderOptionsSpec object by using its constructor.
Set the PDFAConformance value by assigning a PDFAConformance enum value to the RenderOptionsSpec object’s PDFAConformance data member. For example, to specify conformance level A, assign PDFAConformance.A to this data member.
Set the PDFARevisionNumber value by assigning a PDFARevisionNumber enum value to the RenderOptionsSpec object’s PDFARevisionNumber data member. Assign PDFARevisionNumber.Revision_1 to this data member.
Note: The PDF version of a PDF/A document is 1.4 no matter what value you specify.
6.
Create a PDF document by invoking the OutputServiceService object’s generatePDFOutput method and passing the following values:
A PDFOutputOptionsSpec object that contains PDF run-time options.
A RenderOptionsSpec object that contains rendering run-time options.
The BLOB object that contains the XML data source that contains data to merge with the form design.
A BLOB object that is populated by the generatePDFOutput method. The generatePDFOutput method populates this object with generated metadata that describes the document. (This parameter value is required only for web service invocation).
A BLOB object that is populated by the generatePDFOutput method. The generatePDFOutput method populates this object with result data. (This parameter value is required only for web service invocation).
An OutputResult object that contains the results of the operation. (This parameter value is required only for web service invocation).
7.
Create a System.IO.FileStream object by invoking its constructor and passing a string value that represents an XML file location that contains result data. Ensure that the file extension is XML.
Create a byte array that stores the data content of the BLOB object that was populated with result data by the OutputServiceService object’s generatePDFOutput method (the eighth parameter). Populate the byte array by getting the value of the BLOB object’s binaryData data member.
Create a System.IO.BinaryWriter object by invoking its constructor and passing the System.IO.FileStream object.
Write the contents of the byte array to the XML file by invoking the System.IO.BinaryWriter object’s Write method and passing the byte array.
View Quick Start
 

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/sdkHelp/outputCreatingPDFA.45.4.html