Mark Stephens Mark has been working with Java and PDF since 1999 and is a big NetBeans fan. He enjoys speaking at conferences. He has an MA in Medieval History and a passion for reading.

What are Form XObjects?

1 min read

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.

In the PDF command stream, a Do command can either reference and Xobject containing an Image or a Form.

Both are defined in the Resources object. XForm objects can have their own Resources (fonts and images,etc) and even XForm objects. They also have a name (ie Fm1). 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.



Are you a Developer working with PDF files?

Our developers guide contains a large number of technical posts to help you understand the PDF file Format.

Find out more about our software for Developers

Mark Stephens Mark has been working with Java and PDF since 1999 and is a big NetBeans fan. He enjoys speaking at conferences. He has an MA in Medieval History and a passion for reading.

Leave a Reply

Your email address will not be published. Required fields are marked *

IDRsolutions Ltd 2022. All rights reserved.