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)
- Introducing the new XFA Parser in FormVu - May 16, 2018
- Moving to JPedal release 8 - May 2, 2018
- Which version of Java SE should I use? - April 25, 2018
- 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