Form XObjects in PDF files

Form XObjects is a way of describing objects (text, images, vector elements,…) within a PDF file. It is meant for repetitive objects that only get stored once in a PDF but referenced multiple times. In a way, Form XObjects are similar to a mini-PDF embedded inside the main PDF document or you could say it is the logical equivalent of an EPS file, i.e. any combination of text, vectors, and images that is kept as a separate entity.

  • A PDF can have Form XObjects inside Form XObjects.
  • Form XObjects can either be internal content (included within the PDF file itself, as is usually the case) or external (as a kind of OPI-alike technology).
  • The concept of Form XObjects can already be found in the PostScript Level 2 specification of 1991. It had been introduced at that time to allow for more efficiency: one could put aside a piece of a page description that could then be used several times on a page or in a whole file. That concept was carried over into PDF.

How Form XObjects get created

There are a number of workflows or applications that can cause Form XObjects to appear in a PDF file. These are some of the possibilities:

  • Adobe InDesign tends to make frequent use of this technology in exported PDF files. Items on master pages are typically turned into Form XObjects.
  • Imposition applications also tend to use Form XObjects for repetitive content. A PDF flat that has been imposed using an imposition tools like KIM PDF or Preps will contain Form XObjects.
  • Many applications or tools, such as Quite A Box Of Tricks, tend to use Form XObjects when processing annotations and Acrobat Form fields.
  • Though not technically required, Acrobat Distiller seems to make Form XObjects whenever there is OPI, even when only made up of a single image which could be represented as the simpler Image XObject. If you do not have an OPI workflow, you can turn off the ‘Preserve OPI’ option in the Distiller Job Options and eliminate many occurrences of Form XObjects.

Issues with Form XObjects

In the distant past Adobe actively discouraged the use of Form XObjects. This may at that time have been caused by restrictions in their own PDFLibrary API. Some tools that used this API, such as early versions of Enfocus PitStop, were fairly restricted in their handling of  Form XObjects. Those old PitStop versions could for instance not properly preflight Form XObjects nor could such elements be edited. Meanwhile those limitations have been resolved. There may still be tools that have problems in handling Form XObjects but I am not aware of any.

In recent years I haven’t heard any discouraging comments about the use of Form XObjects any more.

9 August 2013

4 responses to “Form XObjects in PDF files”

  1. Amy says:

    I received a PDF that is poorly structured in that the same XObject is placed on each page, representing the “boiler place” form, but each instance has a unique name. So in a 1000 page PDF, where there should be only one XObject for the form, there are 1000. Is there any tool that can compare them and clean up the structure of the PDF? Or is there any way to clean up the PDF?

    • Laurens says:

      If the optimisation tools in Acrobat Professional can’t fix this automatically, I wouldn’t know how to get this cleaned up.

  2. David Low says:

    I am trying to work with a pdf progamatically through FoxPro using
    createObject(“AcroExch.App”)
    createObject(“AcroExch.AvDoc”)
    createObject(“AcroExch.PDDoc”)

    I am able to open acrobat, add pages fill in some fields with the “AFormAut.App” object.

    Now I want to insert images into the pdf.
    I cant find a which object to work with?
    I wish there was a way to do it just as I did with the things i mentioned above.

    • Laurens says:

      Sorry, I cannot help you with this. This site is about working with PDF files in a prepress environment. I am not into the programming or encoding side of things.


Advertising