Mark Stephens I have been working with Java and PDF since 1999 and am a big NetBeans fan. I enjoy speaking at conferences. I have an MA in Medieval History and a passion for reading.

Understanding the PDF File format – Form XObjects

52 sec 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.

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!

IDRsolutions develop a Java PDF Viewer and SDK, an Adobe forms to HTML5 forms converter, a PDF to HTML5 converter and a Java ImageIO replacement. On the blog our team post anything interesting they learn about.

Mark Stephens I have been working with Java and PDF since 1999 and am a big NetBeans fan. I enjoy speaking at conferences. I have 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 2019. All rights reserved.