Can I add barcodes to a PDF with the Adobe PDF Library?
Estimated Reading Time: 1 MinutesStandard or linear barcodes such as the UPC barcode or the Code 3 of 9 barcode can be found in a number of font formats. These fonts can be placed in a PDF with the Adobe PDF Library and the character strings representing the data can be added in the same manner as you place other character strings.
However, the Library has no built-in ability to determine what should go into that barcode character stream. The application using the PDF Library needs to implement the code for that. For example, some barcode information needs a checksum embedded into the stream as well as Start and Stop patterns so that the scanner knows where to start and stop reading the data.
A 2D barcode, such as the Datamatrix barcode (also known as a matrix code) is a two-dimensional way of representing information. It is similar to a linear (one dimensional) barcode, but can represent more data by "stacking" rows. While the 2D symbol representing the data may have been composed from a standard font, when embedded into a PDF, it is often embedded as an image.
A number of encoder/decoder packages are available from third party vendors for creating these images. These images can be embedded into a PDF document using the PDF Library.