Creating PDF Documents
You can use the Output service to create a PDF document that is based on a form design and XML form data that you provide. The PDF document that is created by the Output service is not an interactive PDF document; a user cannot enter or modify form data.
If you want to create a PDF document meant for long-term storage, it is recommended that you create a PDF/A document. (See Creating PDF/A Documents.)
To create an interactive PDF form that lets a user enter data, use the Forms service. (See Rendering Interactive PDF Forms.)
Summary of steps
To create a PDF document, perform the following steps:
- Include project files.
- Create an Output Client object.
- Reference an XML data source.
- Set PDF run-time options.
- Set rendering run-time options.
- Generate a PDF document.
- Retrieve the results of the operation.
Include project files
Include necessary files in your development project. If you are creating a client application by using Java, include the necessary JAR files. If you are using web services, make sure that you include the proxy files.
The following JAR files must be added to your project’s classpath:
- adobe-livecycle-client.jar
- adobe-usermanager-client.jar
- adobe-output-client.jar
- adobe-utilities.jar (Required if AEM Forms is deployed on JBoss)
- jbossall-client.jar (Required if AEM Forms is deployed on JBoss)
if AEM Forms is deployed on a supported J2EE application server that is not JBoss, you will need to replace the adobe-utilities.jar and jbossall-client.jar files with JAR files that are specific to the J2EE application server on which AEM Forms is deployed.
Create an Output Client object
Before you can programmatically perform an Output service operation, you must create an Output service client object. If you are using the Java API, create an OutputClient
object. If you are using the Output web service API, create an OutputServiceService
object.
Reference an XML data source
To merge data with the form design, you must reference an XML data source that contains data. An XML element must exist for every form field that you plan to populate with data. The XML element name must match the field name. An XML element is ignored if it does not correspond to a form field or if the XML element name does not match the field name. It is not necessary to match the order in which the XML elements are displayed if all XML elements are specified.
Consider the following example loan application form.
To merge data into this form design, you must create an XML data source that corresponds to the form. The following XML represents an XDP XML data source that corresponds to the example mortgage application form.
<?xml version="1.0" encoding="UTF-8" ?>
- <xfa:datasets xmlns:xfa="https://www.xfa.org/schema/xfa-data/1.0/">
- <xfa:data>
- <data>
- <Layer>
<closeDate>1/26/2007</closeDate>
<lastName>Johnson</lastName>
<firstName>Jerry</firstName>
<mailingAddress>JJohnson@NoMailServer.com</mailingAddress>
<city>New York</city>
<zipCode>00501</zipCode>
<state>NY</state>
<dateBirth>26/08/1973</dateBirth>
<middleInitials>D</middleInitials>
<socialSecurityNumber>(555) 555-5555</socialSecurityNumber>
<phoneNumber>5555550000</phoneNumber>
</Layer>
- <Mortgage>
<mortgageAmount>295000.00</mortgageAmount>
<monthlyMortgagePayment>1724.54</monthlyMortgagePayment>
<purchasePrice>300000</purchasePrice>
<downPayment>5000</downPayment>
<term>25</term>
<interestRate>5.00</interestRate>
</Mortgage>
</data>
</xfa:data>
</xfa:datasets>
Set PDF run-time options
Set the file URI option when creating a PDF document. This option specifies the name and location of the PDF file that the Output service generates.
Set rendering run-time options
You can set rendering run-time options when creating a PDF document. Although these options are not required (unlike PDF run-time options that are required), you can perform tasks such as improving the performance of the Output service. For example, you can cache the form design that the Output service uses in order to improve its performance.
If you use a tagged Acrobat form as input, you cannot use the Output service Java or web service API to turn off the tagged setting. If you attempt to programmatically set this option to false
, the result PDF document is still tagged.
RenderOptionsSpec
class reference. (See AEM Forms API Reference).Generate a PDF document
After you reference a valid XML data source that contains form data and you set run-time options, you can invoke the Output service, which results in it generating a PDF document.
When generating a PDF document, you specify URI values that are required by the Output service to create a PDF document. A form design can be stored in locations such as the server file system or as part of an AEM Forms application. A form design (or other resources such as an image file) that exists as part of a Forms application can be referenced by using the content root URI value repository:///
. For example, consider the following form design named Loan.xdp located within a Forms application named Applications/FormsApplication:
To access the Loan.xdp file shown in the previous illustration, specify repository:///Applications/FormsApplication/1.0/FormsFolder/
as the third parameter passed to the OutputClient
object’s generatePDFOutput
method. Specify the form name (Loan.xdp) as the second parameter passed to the OutputClient
object’s generatePDFOutput
method.
If the XDP file contains images (or other resources such as fragments), place the resources in the same application folder as the XDP file. AEM Forms uses the content root URI as the base path to resolve references to images. For example, if the Loan.xdp file contains an image, ensure that you place the image in Applications/FormsApplication/1.0/FormsFolder/
.
OutputClient
object’s generatePDFOutput
or generatePrintedOutput
methods.Retrieve the results of the operation
After the Output service performs an operation, it returns various data items such as status XML data that specifies whether the operation was successful.
See also
Create a PDF document using the Java API
Create a PDF document using the web service API
Create a PDF document using the Java API
Create a PDF document by using the Output API (Java):
-
Include project files.
Include client JAR files, such as adobe-output-client.jar, in your Java project’s class path.
-
Create an Output Client object.
- Create a
ServiceClientFactory
object that contains connection properties. - Create an
OutputClient
object by using its constructor and passing theServiceClientFactory
object.
- Create a
-
Reference an XML data source.
- Create a
java.io.FileInputStream
object that represents the XML data source that is used to populate the PDF document by using its constructor and passing a string value that specifies the location of the XML file. - Create a
com.adobe.idp.Document
object by using its constructor. Pass thejava.io.FileInputStream
object.
- Create a
-
Set PDF run-time options.
- Create a
PDFOutputOptionsSpec
object by using its constructor. - Set the File URI option by invoking the
PDFOutputOptionsSpec
object’ssetFileURI
method. Pass a string value that specifies the location of the PDF file that the Output service generates. The File URI option is relative to the J2EE application server hosting AEM Forms, not the client computer.
- Create a
-
Set rendering run-time options.
- Create a
RenderOptionsSpec
object by using its constructor. - Cache the form design to improve the performance of the Output service by invoking the
RenderOptionsSpec
object’ssetCacheEnabled
and passingtrue
.
NOTE
You cannot set the version of the PDF document by using theRenderOptionsSpec
object’ssetPdfVersion
method if the input document is an Acrobat form (a form created in Acrobat) or an XFA document that is signed or certified. The output PDF document retains the original PDF version. Likewise, you cannot set the tagged Adobe PDF option by invoking theRenderOptionsSpec
object’ssetTaggedPDF
* method if the input document is an Acrobat form or a signed or certified XFA document. *NOTE
You cannot set the linearized PDF option by using theRenderOptionsSpec
object’ssetLinearizedPDF
method if the input PDF document is certified or digitally signed. (See Digitally Signing PDF Documents.) - Create a
-
Generate a PDF document.
Create a PDF document by invoking the
OutputClient
object’sgeneratePDFOutput
method and passing the following values:- A
TransformationFormat
enumeration value. To generate a PDF document, specifyTransformationFormat.PDF
. - A string value that specifies the name of the form design.
- A string value that specifies the content root where the form design is located.
- A
PDFOutputOptionsSpec
object that contains PDF run-time options. - A
RenderOptionsSpec
object that contains rendering run-time options. - The
com.adobe.idp.Document
object that contains the XML data source that contains data to merge with the form design.
The
generatePDFOutput
method returns anOutputResult
object that contains the results of the operation.NOTE
When generating a PDF document by invoking thegeneratePDFOutput
method, be aware that you cannot merge data with an XFA PDF form that is signed or certified. (See Digitally Signing and Certifying Documents.)NOTE
TheOutputResult
object’sgetRecordLevelMetaDataList
method returnsnull
.NOTE
You can also create a PDF document by invoking theOutputClient
object’sgeneratePDFOutput2
method. (See Passing Documents located in Content Services (deprecated) to the Output Service.) - A
-
Retrieve the results of the operation.
- Retrieve a
com.adobe.idp.Document
object that represents the status of thegeneratePDFOutput
operation by invoking theOutputResult
object’sgetStatusDoc
method. This method returns status XML data that specifies whether the operation was successful. - Create a
java.io.File
object that contains the results of the operation. Ensure that the file name extension is .xml. - Invoke the
com.adobe.idp.Document
object’scopyToFile
method to copy the contents of thecom.adobe.idp.Document
object to the file (ensure that you use thecom.adobe.idp.Document
object that was returned by thegetStatusDoc
method).
Although the Output service writes the PDF document to the location specified by the argument that is passed to the
PDFOutputOptionsSpec
object’ssetFileURI
method, you can programmatically retrieve the PDF/A document by invoking theOutputResult
object’sgetGeneratedDoc
method. - Retrieve a
Create a PDF document using the web service API
Create a PDF document by using the Output API (web service):
-
Include project files.
Create a Microsoft .NET project that uses MTOM. Ensure that you use the following WSDL definition:
http://localhost:8080/soap/services/OutputService?WSDL&lc_version=9.0.1
.NOTE
Replacelocalhost
* with the IP address of the server hosting AEM Forms. * -
Create an Output Client object.
-
Create an
OutputServiceClient
object by using its default constructor. -
Create an
OutputServiceClient.Endpoint.Address
object by using theSystem.ServiceModel.EndpointAddress
constructor. Pass a string value that specifies the WSDL to the AEM Forms service (for example,http://localhost:8080/soap/services/OutputService?blob=mtom
.) You do not need to use thelc_version
attribute. This attribute is used when you create a service reference. However, specify?blob=mtom
to use MTOM. -
Create a
System.ServiceModel.BasicHttpBinding
object by getting the value of theOutputServiceClient.Endpoint.Binding
field. Cast the return value toBasicHttpBinding
. -
Set the
System.ServiceModel.BasicHttpBinding
object’sMessageEncoding
field toWSMessageEncoding.Mtom
. This value ensures that MTOM is used. -
Enable basic HTTP authentication by performing the following tasks:
- Assign the AEM forms user name to the field
OutputServiceClient.ClientCredentials.UserName.UserName
. - Assign the corresponding password value to the field
OutputServiceClient.ClientCredentials.UserName.Password
. - Assign the constant value
HttpClientCredentialType.Basic
to the fieldBasicHttpBindingSecurity.Transport.ClientCredentialType
. - Assign the constant value
BasicHttpSecurityMode.TransportCredentialOnly
to the fieldBasicHttpBindingSecurity.Security.Mode
.
- Assign the AEM forms user name to the field
-
-
Reference an XML data source.
- Create a
BLOB
object by using its constructor. TheBLOB
object is used to store XML data that will be merged with the PDF document. - Create a
System.IO.FileStream
object by invoking its constructor and passing a string value that represents the file location of the XML file that contains form data. - 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 theSystem.IO.FileStream
object’sLength
property. - Populate the byte array with stream data by invoking the
System.IO.FileStream
object’sRead
method and passing the byte array, the starting position, and the stream length to read. - Populate the
BLOB
object by assigning itsMTOM
field with the contents of the byte array.
- Create a
-
Set PDF run-time options
- 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’sfileURI
data member. The File URI option is relative to the J2EE application server hosting AEM Forms, not the client computer.
- Create a
-
Set rendering run-time options.
- Create a
RenderOptionsSpec
object by using its constructor. - Cache the form design to improve the performance of the Output service by assigning the value
true
to theRenderOptionsSpec
object’scacheEnabled
data member.
NOTE
You cannot set the version of the PDF document by using theRenderOptionsSpec
object’ssetPdfVersion
method if the input document is an Acrobat form (a form created in Acrobat) or an XFA document that is signed or certified. The output PDF document retains the original PDF version. Likewise, you cannot set the tagged Adobe PDF option by invoking theRenderOptionsSpec
object’ssetTaggedPDF
* method if the input document is an Acrobat form or a signed or certified XFA document.*NOTE
You cannot set the linearized PDF option by using theRenderOptionsSpec
object’slinearizedPDF
member if the input PDF document is certified or digitally signed. (See Digitally Signing PDF Documents.) - Create a
-
Generate a PDF document.
Create a PDF document by invoking the
OutputServiceService
object’sgeneratePDFOutput
method and passing the following values:- A
TransformationFormat
enumeration value. To generate a PDF document, specifyTransformationFormat.PDF
. - A string value that specifies the name of the form design.
- A string value that specifies the content root where the form design is located.
- 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 thegeneratePDFOutput
method. ThegeneratePDFOutput
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 thegeneratePDFOutput
method. ThegeneratePDFOutput
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).
NOTE
When generating a PDF document by invoking thegeneratePDFOutput
method, be aware that you cannot merge data with an XFA PDF form that is signed or certified. (See Digitally Signing and Certifying Documents.)NOTE
You can also create a PDF document by invoking theOutputClient
object’sgeneratePDFOutput2
method. (See Passing Documents located in Content Services (deprecated) to the Output Service.) - A
-
Retrieve the results of the operation.
- 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 name extension is .xml. - Create a byte array that stores the data content of the
BLOB
object that was populated with result data by theOutputServiceService
object’sgeneratePDFOutput
method (the eighth parameter). Populate the byte array by getting the value of theBLOB
object’sMTOM
field
. - Create a
System.IO.BinaryWriter
object by invoking its constructor and passing theSystem.IO.FileStream
object. - Write the contents of the byte array to the XML file by invoking the
System.IO.BinaryWriter
object’sWrite
method and passing the byte array.
See also
Invoking AEM Forms using SwaRef
NOTE
TheOutputServiceService
object’sgenerateOutput
method is deprecated. - Create a
Creating PDF/A Documents
You can use the Output service to create a PDF/A document. Because PDF/A is an archival format for long-term preservation of the document’s content, all fonts are embedded and the file is uncompressed. As a result, a PDF/A document is typically larger than a standard PDF document. In addition, a PDF/A document does not contain audio and video content. Like other Output service tasks, you provide both a form design and data to merge with a form design to create a PDF/A document.
The PDF/A-1 specification consists of two levels of conformance, namely a and b. The major difference between the two is regarding the logical structure (accessibility) support, which is not required for conformance level b. Regardless of the conformance level, PDF/A-1 dictates that all fonts are embedded in the generated PDF/A document.
Although PDF/A is the standard for archiving PDF documents, it is not mandatory that PDF/A be used for archiving if a standard PDF document meets your company’s needs. The purpose of the PDF/A standard is to establish a PDF file that can be stored for a long period of time as well as meet document preservation requirements. For example, a URL cannot be embedded in a PDF/A because over time the URL may become invalid.
Your organization must assess its own needs, the length of time you intend to keep the document, file size considerations, and determine your own archiving strategy. You can programmatically determine if a PDF document is PDF/A compliant by using the DocConverter service. (See Programmatically Determining PDF/A Compliancy.)
A PDF/A document must use the font that is specified in the form design and fonts cannot be substituted. As a result, if a font that is located within a PDF document is not available on the host operating system (OS), then an exception occurs.
When a PDF/A document is opened in Acrobat, a message is displayed that confirms that the document is a PDF/A document, as shown in the following illustration.
Summary of steps
To create a PDF/A document, perform the following steps:
- Include project files.
- Create an Output Client object.
- Reference an XML data source.
- Set PDF/A run-time options.
- Set rendering run-time options.
- Generate a PDF/A document.
- Retrieve the results of the operation.
Include project files
Include necessary files in your development project. If you are creating a custom application by using Java, include the necessary JAR files. If you are using web services, make sure that you include the proxy files.
The following JAR files must be added to your project’s class path:
- adobe-livecycle-client.jar
- adobe-usermanager-client.jar
- adobe-output-client.jar
- adobe-utilities.jar (Required if AEM Forms is deployed on JBoss)
- jbossall-client.jar (Required if AEM Forms is deployed on JBoss)
if AEM Forms is deployed on a supported J2EE application server that is not JBoss, you will need to replace the adobe-utilities.jar and jbossall-client.jar files with JAR files that are specific to the J2EE application server on which AEM Forms is deployed.
Create an Output Client object
Before you can programmatically perform an Output service operation, you must create an Output service client object. If you are using the Java API, create an OutputClient
object. If you are using the Output web service API, create an OutputServiceService
object.
Reference an XML data source
To merge data with the form design, you must reference an XML data source that contains data. An XML element must exist for every form field that you want to populate with data. The XML element name must match the field name. An XML element is ignored if it does not correspond to a form field or if the XML element name does not match the field name. It is not necessary to match the order in which the XML elements are displayed if all XML elements are specified.
Set PDF/A run-time options
You can set the File URI option when creating a PDF/A document. The URI is relative to the J2EE application server hosting AEM Forms. That is, if you set C:\Adobe, the file is written to the folder on the server, not the client computer. The URI specifies the name and location of the PDF/A file that the Output service generates.
Set rendering run-time options
You can set rendering run-time options when creating PDF/A documents. Two PDF/A related options that you can set are the PDFAConformance
and PDFARevisionNumber
values. The PDFAConformance
value refers to how a PDF document adheres to requirements that specify how long-term electronic documents are preserved. Valid values for this option are A
and B
. For information about level a and b conformance, see the PDF/A-1 ISO specification that is titled ISO 19005-1 Document management.
The PDFARevisionNumber
value refers to the revision number of a PDF/A document. For information about the revision number of a PDF/A document, see the PDF/A-1 ISO specification that is titled ISO 19005-1 Document management.
false
when creating a PDF/A 1A document. PDF/A 1A will always be a tagged PDF document. Also, you cannot set the tagged Adobe PDF option to true
when creating a PDF/A 1B document. PDF/A 1B will always be an untagged PDF document.Generate a PDF/A document
After you reference a valid XML data source that contains form data and you set run-time options, you can invoke the Output service, causing it to generate a PDF/A document.
Retrieve the results of the operation
After the Output service performs an operation, it returns various data items such as XML data that specifies whether the operation was successful.
See also
Create a PDF/A document using the Java API
Create a PDF/A document using the web service API
Create a PDF/A document using the Java API
Create a PDF/A document by using the Output API (Java):
-
Include project files.
Include client JAR files, such as adobe-output-client.jar, in your Java project’s class path.
-
Create an Output Client object.
- Create a
ServiceClientFactory
object that contains connection properties. - Create an
OutputClient
object by using its constructor and passing theServiceClientFactory
object.
- Create a
-
Reference an XML data source.
- Create a
java.io.FileInputStream
object that represents the XML data source that is used to populate the PDF/A document by using its constructor and passing a string value that specifies the location of the XML file. - Create a
com.adobe.idp.Document
object by using its constructor and passing thejava.io.FileInputStream
object.
- Create a
-
Set PDF/A run-time options.
- Create a
PDFOutputOptionsSpec
object by using its constructor. - Set the File URI option by invoking the
PDFOutputOptionsSpec
object’ssetFileURI
method. Pass a string value that specifies the location of the PDF file that the Output service generates. The File URI option is relative to the J2EE application server hosting AEM Forms, not the client computer.
- Create a
-
Set rendering run-time options.
- Create a
RenderOptionsSpec
object by using its constructor. - Set the
PDFAConformance
value by invoking theRenderOptionsSpec
object’ssetPDFAConformance
method and passing aPDFAConformance
enum value that specifies the conformance level. For example, to specify conformance level A, passPDFAConformance.A
. - Set the
PDFARevisionNumber
value by invoking theRenderOptionsSpec
object’ssetPDFARevisionNumber
method and passingPDFARevisionNumber.Revision_1
.
NOTE
The PDF version of a PDF/A document is 1.4 regardless of which value you specify for theRenderOptionsSpec
object’ssetPdfVersion
method. - Create a
-
Generate a PDF/A document.
Create a PDF/A document by invoking the
OutputClient
object’sgeneratePDFOutput
method and passing the following values:- A
TransformationFormat
enumeration value. To generate a PDF/A document, specifyTransformationFormat.PDFA
. - A string value that specifies the name of the form design.
- A string value that specifies the content root where the form design is located.
- A
PDFOutputOptionsSpec
object that contains PDF run-time options. - A
RenderOptionsSpec
object that contains rendering run-time options. - The
com.adobe.idp.Document
object that contain the XML data source that contains data to merge with the form design.
The
generatePDFOutput
method returns anOutputResult
object that contains the results of the operation.NOTE
TheOutputResult
object’sgetRecordLevelMetaDataList
method returnsnull
*. *NOTE
You can also create a PDF /A document by invoking theOutputClient
object’sgeneratePDFOutput
2 method. (See Passing Documents located in Content Services (deprecated) to the Output Service.) - A
-
Retrieve the results of the operation.
- Create a
com.adobe.idp.Document
object that represents the status of thegeneratePDFOutput
method by invoking theOutputResult
object’sgetStatusDoc
method. - Create a
java.io.File
object that will contain the results of the operation. Ensure that the file name extension is .xml. - Invoke the
com.adobe.idp.Document
object’scopyToFile
method to copy the contents of thecom.adobe.idp.Document
object to the file (ensure that you use thecom.adobe.idp.Document
object that was returned by thegetStatusDoc
method).
NOTE
Although the Output service writes the PDF/A document to the location specified by the argument that is passed to thePDFOutputOptionsSpec
object’ssetFileURI
method, you can programmatically retrieve the PDF/A document by invoking theOutputResult
object’sgetGeneratedDoc
* method.* - Create a
Create a PDF/A document using the web service API
Create a PDF/A document by using the Output API (web service):
-
Include project files.
Create a Microsoft .NET project that uses MTOM. Ensure that you use the following WSDL definition:
http://localhost:8080/soap/services/OutputService?WSDL&lc_version=9.0.1
.NOTE
Replacelocalhost
* with the IP address of the server hosting AEM Forms. * -
Create an Output Client object.
-
Create an
OutputServiceClient
object by using its default constructor. -
Create an
OutputServiceClient.Endpoint.Address
object by using theSystem.ServiceModel.EndpointAddress
constructor. Pass a string value that specifies the WSDL to the AEM Forms service (for example,http://localhost:8080/soap/services/OutputService?blob=mtom
.) You do not need to use thelc_version
attribute. This attribute is used when you create a service reference. However, specify?blob=mtom
to use MTOM. -
Create a
System.ServiceModel.BasicHttpBinding
object by getting the value of theOutputServiceClient.Endpoint.Binding
field. Cast the return value toBasicHttpBinding
. -
Set the
System.ServiceModel.BasicHttpBinding
object’sMessageEncoding
field toWSMessageEncoding.Mtom
. This value ensures that MTOM is used. -
Enable basic HTTP authentication by performing the following tasks:
- Assign the AEM forms user name to the field
OutputServiceClient.ClientCredentials.UserName.UserName
. - Assign the corresponding password value to the field
OutputServiceClient.ClientCredentials.UserName.Password
. - Assign the constant value
HttpClientCredentialType.Basic
to the fieldBasicHttpBindingSecurity.Transport.ClientCredentialType
. - Assign the constant value
BasicHttpSecurityMode.TransportCredentialOnly
to the fieldBasicHttpBindingSecurity.Security.Mode
.
- Assign the AEM forms user name to the field
-
-
Reference an XML data source.
- Create a
BLOB
object by using its constructor. TheBLOB
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 theSystem.IO.FileStream
object’sLength
property. - Populate the byte array with stream data by invoking the
System.IO.FileStream
object’sRead
method and passing the byte array, the starting position, and the stream length to read. - Populate the
BLOB
object by assigning itsMTOM
field with the byte array contents.
- Create a
-
Set PDF/A run-time options.
- 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’sfileURI
data member. The File URI option is relative to the J2EE application server hosting AEM Forms, not the client computer
- Create a
-
Set rendering run-time options.
- Create a
RenderOptionsSpec
object by using its constructor. - Set the
PDFAConformance
value by assigning aPDFAConformance
enum value to theRenderOptionsSpec
object’sPDFAConformance
data member. For example, to specify conformance level A, assignPDFAConformance.A
to this data member. - Set the
PDFARevisionNumber
value by assigning aPDFARevisionNumber
enum value to theRenderOptionsSpec
object’sPDFARevisionNumber
data member. AssignPDFARevisionNumber.Revision_1
to this data member.
NOTE
The PDF version of a PDF/A document is 1.4 regardless of which value you specify. - Create a
-
Generate a PDF/A document.
Create a PDF document by invoking the
OutputServiceService
object’sgeneratePDFOutput
method and passing the following values:- A TransformationFormat enumeration value. To generate a PDF document, specify
TransformationFormat.PDFA
. - A string value that specifies the name of the form design.
- A string value that specifies the content root where the form design is located.
- 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 thegeneratePDFOutput
method. ThegeneratePDFOutput
method populates this object with generated metadata that describes the document. (This parameter value is required for web service invocation only.) - A
BLOB
object that is populated by thegeneratePDFOutput
method. ThegeneratePDFOutput
method populates this object with result data. (This parameter value is required for web service invocation only.) - An
OutputResult
object that contains the results of the operation. (This parameter value is required for web service invocation only.)
NOTE
You can also create a PDF /A document by invoking theOutputClient
object’sgeneratePDFOutput
2 method. (See Passing Documents located in Content Services (deprecated) to the Output Service.) - A TransformationFormat enumeration value. To generate a PDF document, specify
-
Retrieve the results of the operation.
- 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 name extension is .xml. - Create a byte array that stores the data content of the
BLOB
object that was populated with result data by theOutputServiceService
object’sgeneratePDFOutput
method (the eighth parameter). Populate the byte array by getting the value of theBLOB
object’sMTOM
field. - Create a
System.IO.BinaryWriter
object by invoking its constructor and passing theSystem.IO.FileStream
object. - Write the contents of the byte array to the XML file by invoking the
System.IO.BinaryWriter
object’sWrite
method and passing the byte array.
- Create a