Appendix B. Creating barcodes

We briefly discussed the abstract class com.lowagie.text.pdf.Barcode in chapter 5, and appendix A section A.5 gave you an overview of the Barcode subclasses. These classes provide a user-friendly way to create an Image instance that represents a barcode.

This could be a com.lowagie.text.Image or a java.awt.Image class. There’s also a method to place the barcode on a PdfContentByte object and to create a PdfTemplate containing the barcode.

In this appendix, which is a specific extension of chapter 5, we’ll look at an example of every barcode type supported in iText.

Barcodes to identify products

If you live in America or Canada and you go to your retail store, you’re probably familiar with Universal Product Code (UPC

Get iText in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.