Form XObjects (not be confused with forms which are buttons, checkboxes, buttons, etc) are an advanced feature of the PDF file format. They can be thought of as sub-rountines (or even mini-PDFs) which are used on the main PDF display.
They are defined in the Resources object and can have their own Resources (fonts and images,etc). They also have a name (ie Fm1) and are drawn using the Do operator. So if you see Do /Fm1 in the PDF command stream, it is probably a form. Like images, they will be scaled and rotated using the current GraphicState settings but they offer more flexibility.
Here is what you might see in the Object tree (shown in Acrobat for a Form). Note it has a content stream of commands (which I have not shown).
Like images, this allows you to save space by reusing the Object over and over again. It is also popular with PDF creation tools because it allows you to logically separate out blocks – for example flattened form data, stamps or any logical item can be created as an Form XObject, complete with its own fonts and resources.
This post is part of our “Understanding the PDF File Format” series. In each article, we aim to take a specific PDF feature and explain it in simple terms. 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