AEM 6.4 has reached the end of extended support and this documentation is no longer updated. For further details, see our technical support periods. Find the supported versions here.
The barcoded forms service automates the capture of data from fill-and-print forms and integrates captured information into an organization’s core IT systems.
Using the barcoded forms service, you can add one-dimensional and two-dimensional barcodes to interactive PDF forms. You can then publish the barcoded forms to a website or distribute them by email or CD. When a user fills a barcoded form by using Adobe Reader, Acrobat Professional, or Acrobat Standard, the barcode is updated automatically to encode the user-supplied form data. The user can submit the form electronically, or print it to paper and submit it by mail, fax, or hand. You can later extract the user-supplied data as part of an automated workflow, routing the data among approval processes and business systems.
For more information about the barcoded forms service, see Services Reference for AEM Forms.
You can use the barcoded forms service API to decode data from a PDF form or an image that contains a barcode. Decoding form data means extracting data that is located in the barcode. Before data can be decoded from a PDF form (or image), a user has to populate the form with data.
For more information about the barcoded forms service, see Services Reference for AEM Forms.
To decode data from a PDF form, perform the following steps:
Include project files
Include necessary files into your development project. If you are creating a client application using Java, then include the necessary JAR files. If you are using web services, then make sure that you include the proxy files.
The following JAR files must be added to your project’s classpath:
If AEM Forms is deployed on a supported J2EE application server that is not JBOSS, then you will need to replace adobe-utilities.jar and jbossall-client.jar with JAR files that are specific to the J2EE application server on which AEM Forms is deployed. For information about the location of all AEM Forms JAR files, see Including AEM Forms Java library files.
Create a barcoded forms Client API object
Before you can programmatically perform a barcoded forms service operation, you must create a Barcoded Forms service client. If you are using the Java API, create a BarcodedFormsServiceClient
object. If you are using the barcoded forms web service API, create a BarcodedFormsServiceService
object.
Get a PDF form that contains barcoded data
You must obtain a PDF form that contains a barcode that has been populated with user data.
Decode the data from the PDF form
After you obtain a PDF form (or image) that contains a barcode, you can decode data. The Barcoded Forms service supports the following types of barcodes:
Character set input as hex in the decode API implies that the content of the barcode is encoded as a hex string. For example, if UTF-8 is specified as the Character encoding in the form and Hex is specified in the decode operation, the content of the barcode is encoded as a Hex string in the < xb:content
> element in the decoded output. You can convert this Hex value to get the original content by creating application logic in your client application.
Convert the data to an XML data source
After you decode form data, you can convert it to XDP or XFDF data. For example, assume that you want to import the data into another form. To import the data into an XFA form, then you have to convert the data to XDP data. For information, see Importing Form Data.
Process the decoded data
You can process the converted data to meet your business requirements. For example, after you decode and convert the data, you can save it to a file, store it in an enterprise database, populate another form, and so on. This section discusses how to save the converted data as an XML file.
The barcoded forms service fails to decode barcode data when the line delimiter and field delimiter parameters have the same value
See also
Decode barcoded form data using the Java API
Decode barcoded form data using the web service API
Including AEM Forms Java library files
Decode form data by using the barcoded forms API(Java):
Include project files
Include client JAR files in your Java project’s class path.
Create a barcoded forms Client API object
Create a BarcodedFormsServiceClient
object by using its constructor and passing a ServiceClientFactory
object that contains connection properties.
Get a PDF form that contains barcoded data
java.io.FileInputStream
object that represents the PDF form that contains barcoded data by using its constructor and passing a string value that specifies the location of the PDF document.com.adobe.idp.Document
object by using its constructor and passing the java.io.FileInputStream
object.Decode the data from the PDF form
Decode the form data by invoking the BarcodedFormsServiceClient
object’s decode
method and passing the following values:
com.adobe.idp.Document
object that contains the PDF form.java.lang.Boolean
object that specifies whether to decode a PDF417 barcode.java.lang.Boolean
object that specifies whether to decode a data matrix barcode.java.lang.Boolean
object that specifies whether to decode a QR code barcode.java.lang.Boolean
object that specifies whether to decode a codabar barcode.java.lang.Boolean
object that specifies whether to decode a code 128 barcode.java.lang.Boolean
object that specifies whether to decode a code 39 barcode.java.lang.Boolean
object that specifies whether to decode an EAN-13 barcode.java.lang.Boolean
object that specifies whether to decode an EAN-8 barcode.com.adobe.livecycle.barcodedforms.CharSet
enumeration value that specifies the character set encoding value used in the barcode.The decode
method returns an org.w3c.dom.Document
object that contains decoded form data.
Convert the data to an XML data source
Convert the decoded data into either XDP or XFDF data by invoking the BarcodedFormsServiceClient
object’s extractToXML
method and passing the following values:
org.w3c.dom.Document
object that contains decoded data (ensure that you use the decode
method’s return value).com.adobe.livecycle.barcodedforms.Delimiter
enumeration value that specifies the line delimiter. It is recommended that you specify Delimiter.Carriage_Return
.com.adobe.livecycle.barcodedforms.Delimiter
enumeration value that specifies the field delimiter. For example, specify Delimiter.Tab
.com.adobe.livecycle.barcodedforms.XMLFormat
enumeration value that specifies whether to convert the barcode data into XDP or XFDF XML data. For example, specify XMLFormat.XDP
to convert the data to XDP data.Do not specify the same values for the line delimiter and field delimiter parameters.
The extractToXML
method returns a java.util.List
object where each element is an org.w3c.dom.Document
object. There is a separate element for each barcode that is located on the form. That is, if there are four barcodes on the form, then there are four elements in the returned java.util.List
object.
Process the decoded data
java.util.List
object to get each org.w3c.dom.Document
object that is located in the list.org.w3c.dom.Document
object to a com.adobe.idp.Document
object. (The application logic that converts a org.w3c.dom.Document
object into a com.adobe.idp.Document
object is shown in the Decoding barcoded form data using the Java API example).com.adobe.idp.Document
object’s copyToFile
, and passing a File object that represents the XML file.See also
Quick Start (SOAP mode): Decoding barcoded form data using the Java API
Including AEM Forms Java library files
Decode form data by using the barcoded forms API(web service):
Include project files
Create a barcoded forms Client API object
Using the Microsoft .NET client assembly that consumes the barcoded forms service WSDL, create an BarcodedFormsServiceService
object by invoking its default constructor.
Get a PDF form that contains barcoded data
BLOB
object by using its constructor. The BLOB
object is used to store a PDF document that contains a barcode.System.IO.FileStream
object by invoking its constructor and passing a string value that represents the file location of the PDF document and the mode in which to open the file.System.IO.FileStream
object. You can determine the size of the byte array by getting the System.IO.FileStream
object’s Length
property.System.IO.FileStream
object’s Read
method and passing the byte array, the starting position, and the stream length to read.BLOB
object by assigning its binaryData
property with the contents of the byte array.Decode the data from the PDF form
Decode the form data by invoking the BarcodedFormsServiceService
object’s decode
method and passing the following values:
BLOB
object that contains the PDF form.Boolean
object that specifies whether to decode a PDF417 barcode.Boolean
object that specifies whether to decode a data matrix barcode.Boolean
object that specifies whether to decode a QR code barcode.Boolean
object that specifies whether to decode a codabar barcode.Boolean
object that specifies whether to decode a code 128 barcode.Bolean
object that specifies whether to decode a code 39 barcode.Boolean
object that specifies whether to decode an EAN-13 barcode.Boolean
object that specifies whether to decode an EAN-8 barcode.CharSet
enumeration value that specifies the character set encoding value used in the barcode.The decode
method returns a string value that contains decoded form data.
Convert the data to an XML data source
Convert the decoded data into either XDP or XFDF data by invoking the BarcodedFormsServiceService
object’s extractToXML
method and passing the following values:
decode
method’s return value).Delimiter
enumeration value that specifies the line delimiter. It is recommended that you specify Delimiter.Carriage_Return
.Delimiter
enumeration value that specifies the field delimiter. For example, specify Delimiter.Tab
.XMLFormat
enumeration value that specifies whether to convert the barcode data into XDP or XFDF XML data. For example, specify XMLFormat.XDP
to convert the data to XDP data.Do not specify the same values for the line delimiter and field delimiter parameters.
The extractToXML
method returns an Object
array where each element is an BLOB
instance. There is a separate element for each barcode that is located on the form. That is, if there are four barcodes on the form, then there are four elements in the returned Object
array.
Process the decoded data
System.IO.FileStream
object by invoking its constructor and passing a string value that represents the file location of the secured PDF document.BLOB
object that was returned by the encryptPDFUsingPassword
method. Populate the byte array by getting the value of the BLOB
object’s binaryData
data member.System.IO.BinaryWriter
object by invoking its constructor and passing the System.IO.FileStream
object.System.IO.BinaryWriter
object’s Write
method and passing the byte array.See also
Invoking AEM Forms using Base64 encoding