Can I add barcodes to a PDF with the Adobe PDF Library?
Estimated Reading Time: 1 MinutesA QR code can be generated with APDFL C++ interface from a string using the PDPageAddQRBarcode() function. This functionality is exposed in the .Net and Java interfaces as the AddQRCode method of the Page class.
There are other sorts of two-dimensional barcodes, such as the Datamatrix barcode (also known as a matrix code) which are not directly supported by APDFL; such 2D bar codes are often embedded as images.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.
Standard 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.