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 tool 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 that 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.

7 thoughts on “Form XObjects in PDF files

  1. Hi, it seems that Form XObjects give trouble when you want a pdf file which is accessible for screen readers and other accessibility tools. It is hard or even impossible to assign the correct tags (like an alternative text for an illustration, or a header tag) to the individual elements within a Form XObject container.
    Now as you say, this site is about the prepress environment and there it wouldn’t an issue, since the pdf file exists to be printed. However, if the same pdf file is sent to press AND used on a web site, this is something to be aware of.
    When editing pdf files with these objects, I also couldn’t get rid of them: when I tried to move the ‘sub elements’ out of the container, they disappeared wholly from the page, even though I didn’t change there order.
    Best regards, Bram

  2. 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?

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

  3. 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.

    1. 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.

Leave a Reply

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