Summary of steps
To determine whether a PDF document is PDF/A-compliant, perform the following tasks:
- Include project files.
- Create a PDF Assembler client.
- Reference an existing DDX document.
- Reference a PDF document used to determine PDF/A compliancy.
- Set run-time options.
- Retrieve information about the PDF document.
- Save the returned XML document.
Include project files
Include the 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, ensure 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-assembler-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 other than JBoss, you must replace the adobe-utilities.jar and jbossall-client.jar files with JAR files that are specific to the J2EE application server that AEM Forms is deployed on. For information about the location of all AEM Forms JAR files, see Including AEM Forms Java library files.
Create a PDF Assembler client
Before you can programmatically perform an Assembler operation, you must create an Assembler service client.
Reference an existing DDX document
A DDX document must be referenced to perform an Assembler service operation. To determine whether an input PDF document is PDF/A-compliant, ensure that the DDX document contains the PDFAValidation
element within a DocumentInformation
element. The PDFAValidation
element instructs the Assembler service to return an XML document that specifies whether the input PDF document is PDF/A-compliant.
Reference a PDF document used to determine PDF/A compliancy
A PDF document must be referenced and passed to the Assembler service to determine whether the PDF document is PDF/A-compliant.
Set run-time options
You can set run-time options that control the behaviour of the Assembler service while it performs a job. For example, you can set an option that instructs the Assembler service to continue processing a job if an error is encountered. For information about the run-time options that you can set, see the AssemblerOptionSpec
class reference in AEM Forms API Reference.
Retrieve information about the PDF document
After you create the Assembler service client, reference the DDX document, reference an interactive PDF document, and set run-time options, you can invoke the invokeDDX
operation. Because the DDX document contains the DocumentInformation
element, the Assembler service returns XML data instead of a PDF document.
Save the returned XML document
The XML document that the Assembler service returns specifies whether the input PDF document is PDF/A-compliant. For example, if the input PDF document is not PDF/A-compliant, the Assembler service returns an XML document that contains the following element:
<PDFAConformance isCompliant="false" compliance="PDF/A-1b" resultLevel="Detailed" ignoreUnusedResources="true" allowCertificationSignatures="true">
Save the XML document as an XML file so that you can open the file and view the results.
See also
Determine whether a document is PDF/A compliant using the Java API
Determine whether a document is PDF/A compliant using the web service API
Determine whether a document is PDF/A compliant using the Java API
Determine whether a PDF document is PDF/A-compliant by using the Assembler Service API (Java):
-
Include project files.
Include client JAR files, such as adobe-assembler-client.jar, in your Java project’s class path.
-
Create a PDF Assembler client.
- Create a
ServiceClientFactory
object that contains connection properties. - Create an
AssemblerServiceClient
object by using its constructor and passing theServiceClientFactory
object.
- Create a
-
Reference an existing DDX document.
- Create a
java.io.FileInputStream
object that represents the DDX document by using its constructor and passing a string value that specifies the location of the DDX file. To determine whether the PDF document is PDF/A-compliant, ensure that the DDX document contains thePDFAValidation
element that is contained within aDocumentInformation
element. - Create a
com.adobe.idp.Document
object by using its constructor and passing thejava.io.FileInputStream
object.
- Create a
-
Reference a PDF document used to determine PDF/A compliancy.
-
Create a
java.io.FileInputStream
object by using its constructor and passing the location of a PDF document that is used to determine PDF/A compliancy. -
Create a
com.adobe.idp.Document
object by using its constructor and passing thejava.io.FileInputStream
object that contains the PDF document. -
Create a
java.util.Map
object that is used to store the input PDF document by using aHashMap
constructor. -
Add an entry to the
java.util.Map
object by invoking itsput
method and passing the following arguments:- A string value that represents the key name. This value must match the value of the source element specified in the DDX document. For example, the value of the source element in the DDX document that is introduced in this section is Loan.pdf.
- A
com.adobe.idp.Document
object that contains the input PDF document.
-
-
Set run-time options.
- Create an
AssemblerOptionSpec
object that stores run-time options by using its constructor. - Set run-time options to meet your business requirements by invoking a method that belongs to the
AssemblerOptionSpec
object. For example, to instruct the Assembler service to continue processing a job when an error occurs, invoke theAssemblerOptionSpec
object’ssetFailOnError
method and passfalse
.
- Create an
-
Retrieve information about the PDF document.
Invoke the
AssemblerServiceClient
object’sinvokeDDX
method and pass the following required values:- A
com.adobe.idp.Document
object that represents the DDX document to use - A
java.util.Map
object that contains the input PDF file that is used to determine PDF/A compliancy - A
com.adobe.livecycle.assembler.client.AssemblerOptionSpec
object that specifies the run-time options
The
invokeDDX
method returns acom.adobe.livecycle.assembler.client.AssemblerResult
object that contains XML data that specifies whether the input PDF document is PDF/A-compliant. - A
-
Save the returned XML document.
To obtain XML data that specifies whether the input PDF document is a PDF/A document, perform the following actions:
- Invoke the
AssemblerResult
object’sgetDocuments
method. This returns ajava.util.Map
object. - Iterate through the
java.util.Map
object until you find the resultantcom.adobe.idp.Document
object. - Invoke the
com.adobe.idp.Document
object’scopyToFile
method to extract the XML document. Ensure that you save the XML data as an XML file.
- Invoke the
Determine whether a document is PDF/A compliant using the web service API
Determine whether a PDF document is PDF/A-compliant by using the Assembler Service 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/AssemblerService?WSDL&lc_version=9.0.1
.NOTE
Replacelocalhost
with the IP address of the server hosting AEM Forms. -
Create a PDF Assembler client.
-
Create an
AssemblerServiceClient
object by using its default constructor. -
Create an
AssemblerServiceClient.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/AssemblerService?blob=mtom
). You do not need to use thelc_version
attribute. This attribute is used when you create a service reference.) -
Create a
System.ServiceModel.BasicHttpBinding
object by getting the value of theAssemblerServiceClient.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
AssemblerServiceClient.ClientCredentials.UserName.UserName
. - Assign the corresponding password value to the field
AssemblerServiceClient.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 existing DDX document.
- Create a
BLOB
object by using its constructor. TheBLOB
object is used to store the DDX document. - Create a
System.IO.FileStream
object by invoking its constructor and passing a string value that represents the file location of the DDX document and the mode to open the file in. - 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
-
Reference a PDF document used to determine PDF/A compliancy.
- Create a
BLOB
object by using its constructor. TheBLOB
object is used to store the input PDF document. - Create a
System.IO.FileStream
object by invoking its constructor and passing a string value that represents the file location of the input PDF document 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
property with the contents of the byte array. - Create a
MyMapOf_xsd_string_To_xsd_anyType
object. This collection object is used to store the PDF document. - Create a
MyMapOf_xsd_string_To_xsd_anyType_Item
object. - Assign a string value that represents the key name to the
MyMapOf_xsd_string_To_xsd_anyType_Item
object’skey
field. This value must match the value of the PDF source element specified in the DDX document. - Assign the
BLOB
object that stores the PDF document to theMyMapOf_xsd_string_To_xsd_anyType_Item
object’svalue
field. - Add the
MyMapOf_xsd_string_To_xsd_anyType_Item
object to theMyMapOf_xsd_string_To_xsd_anyType
object. Invoke theMyMapOf_xsd_string_To_xsd_anyType
object’Add
method and pass theMyMapOf_xsd_string_To_xsd_anyType
object.
- Create a
-
Set run-time options.
- Create an
AssemblerOptionSpec
object that stores run-time options by using its constructor. - Set run-time options to meet your business requirements by assigning a value to a data member that belongs to the
AssemblerOptionSpec
object. For example, to instruct the Assembler service to continue processing a job when an error occurs, assignfalse
to theAssemblerOptionSpec
object’sfailOnError
data member.
- Create an
-
Retrieve information about the PDF document.
Invoke the
AssemblerServiceService
object’sinvoke
method and pass the following values:- A
BLOB
object that represents the DDX document. - The
MyMapOf_xsd_string_To_xsd_anyType
object that contains the input PDF document. Its keys must match the names of the PDF source files, and its values must be theBLOB
object that corresponds to the input PDF file. - An
AssemblerOptionSpec
object that specifies run-time options.
The
invoke
method returns anAssemblerResult
object that contains XML data that specifies whether the input PDF document is a PDF/A document. - A
-
Save the returned XML document.
To obtain XML data that specifies whether the input PDF document is a PDF/A document, perform the following actions:
- Access the
AssemblerResult
object’sdocuments
field, which is aMap
object that contains the XML data that specifies whether the input PDF document is a PDF/A document. - Iterate through the
Map
object to obtain each resultant document. Then, cast that array member’s value to aBLOB
. - Extract the binary data that represents the XML data by accessing its
BLOB
object’sMTOM
field. This field stores an array of bytes that you can write out to as an XML file.
- Access the
See also
Experience Manager
Espressos & Experience Manager: AEM Forms
Espressos & Experience Manager
Thursday, Mar 6, 7:00 PM UTC
Join Adobe's AEM product team as they highlight AEM Forms' latest innovations, including: the new Gen AI Assistant, Unified Composition with AEM Sites, and new ways to deploy forms through conversations.
RegisterThe True Cost of a Failed Implementation
A failed implementation isn’t just an inconvenience — it costs real revenue. Poor execution and misaligned tools disrupt pipelines,...
Wed, Mar 19, 2:00 PM PDT (9:00 PM UTC)
Rapid Feature Releases with AEM Cloud: Telegraph Media Group’s RDE Strategy
Hear how Telegraph Media Group, the award-winning publisher of The Daily Telegraph, The Sunday Telegraph, The Telegraph Magazine,...
Wed, Mar 19, 3:30 PM PDT (10:30 PM UTC)
Connect with Experience League at Summit!
Get front-row access to top sessions, hands-on activities, and networking—wherever you are!
Learn more