A barcode is a set of lines which contain machine-readable data – run a barcode reader over them and you can access some interesting information (so it is a bit like a sort of braille for machines). As barcodes are very useful and PDF files are very common, it is not surprising that we see quite a few barcodes in PDF files. The interesting thing is that there is no standard way to put a barcode inside a PDF. So here are the different ways we have seen…
Bar code as an image
This is the most common way to do it. The barcode is turned into a single bit-map or vector image and embedded in the PDF.
Barcode as text
A special font is used to show the barcode and a text string is drawn in the PDF file, using the barcode font.
Barcode as a form object
The barcode is added as an annotion which may be text or an image.
Barcode as embbed images
The barcode is added as a set of embedded lines (black or white). When all drawn, the images produce the full barcode.
So while the barcodes may look identical, different PDF creation tools add the barcode in very different ways and will give very different results if you try to extract them.
Do you have any other examples to add to my list?
This post is part of our “Understanding the PDF File Format” series. In each article, we discuss a PDF feature, bug, gotcha or tip. If you wish to learn more about PDF, we have 13 years worth of PDF knowledge and tips, so click here to visit our series index!
Latest posts by Mark Stephens (see all)
- How we are improving our code quality with IDEA in 2018 - March 7, 2018
- How we are improving our code quality with NetBeans in 2018 - March 1, 2018
- 3 ways that the European Union is changing the way Companies write software in 2018 - January 31, 2018
- IDRsolutions product range update for 2018 - January 22, 2018
- 4 ways Companies can make remote working successful - December 21, 2017