Because it turned out that people wanted to extract text from PDFs (and not just view them), Adobe added a feature called marked content. This allows the PDF file to contain additional tags as information, preserving the structure of the text. However, this feature needs to be used in the creation of the PDF – otherwise the additional information is not there!
There is a very easy way to tell if the PDF file has been created in this way. Open the file in Acrobat Reader and look at the properties menu – the Tagged PDF menu option (bottom left entry on the advanced section) tells you if the PDF contains these extra tags. This file does not.
If you can create Tagged PDF, it is worth setting this on by default – the files are not much larger and it makes text extraction much more viable if you need it in the future.
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)
- NetBeans Day in Istanbul at DevFest Conference - November 26, 2015
- 3 steps to creating local mirrored Git repositories for your Continuous tests - November 12, 2015
- My key takeaways from NetBeans Day 2015 - October 26, 2015
- JavaOne keynote 2015 - October 25, 2015
- Want to know what it is like to be at JavaOne 2015? - October 24, 2015