• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 4. Graphics > External Objects

4.7. External Objects

An external object (commonly called an XObject) is a graphics object whose contents are defined by a self-contained content stream, separate from the content stream in which it is used. There are three types of external objects:

  • An image XObject (Section 4.8.4, “Image Dictionaries”) represents a sampled visual image such as a photograph.

  • A form XObject (Section 4.9, “Form XObjects”) is a self-contained description of an arbitrary sequence of graphics objects.

  • A PostScript XObject (Section4.7.1, “PostScript XObjects”) contains a fragment of code expressed in the PostScript page description language. PostScript XObjects are no longer recommended to be used.

Two further categories of external objects, group XObjects and reference XObjects (both PDF 1.4), are actually specialized types of form XObjects with additional properties. See Sections4.9.2, “Group XObjects,” and 4.9.3, “Reference XObjects,” for additional information.

Any XObject can be painted as part of another content stream by means of the Do operator (see Table 4.37). This operator applies to any type of XObject—image, form, or PostScript. The syntax is the same in all cases, although details of the operator's behavior differ depending on the type. (See implementation note 50 in Appendix H.)

Table 4.37. XObject operator
nameDoPaint the specified XObject. The operand name must appear as a key in the XObject subdictionary of the current resource dictionary (see Section 3.7.2, “Resource Dictionaries”). The associated value must be a stream whose TYPE entry, if present, is XObject. The effect of Do depends on the value of the XObject's Subtype entry, which may be Image (see Section 4.8.4, “Image Dictionaries,”), Form (Section 4.9, “Form XObjects”), or PS (Section 4.7.1, “PostScript XObjects”).

4.7.1. PostScript XObjects

Beginning with PDF 1.1, a content stream can include PostScript language fragments. These fragments are used only when printing to a PostScript output device; they have no effect either when viewing the document on-screen or when printing it to a non-PostScript device. In addition, applications that understand PDF are unlikely to be able to interpret the PostScript fragments. Hence, this capability should be used with extreme caution and only if there is no other way to achieve the same result. Inappropriate use of PostScript XObjects can cause PDF files to print incorrectly.


Since PDF 1.4 encompasses all of the Adobe imaging model features of the PostScript language, there is no longer any reason to use PostScript XObjects. This feature is likely to be removed from PDF in a future version.

A PostScript XObject is an XObject stream whose Subtype entry has the value PS. A PostScript XObject dictionary can contain the entries shown in Table 4.38 in addition to the usual entries common to all streams (see Table 3.4 on page 38).

Table 4.38. Additional entries specific to a PostScript XObject dictionary
TYPEname(Optional) The type of PDF object that this dictionary describes; if present, must be XObject for a PostScript XObject.
Subtypename(Required) The type of XObject that this dictionary describes; must be PS for a PostScript XObject.


Alternatively, the value of this entry may be Form, with an additional Subtype2 entry whose value is PS.

Level1stream(Optional) A stream whose contents are to be used in place of the PostScript XObject's stream when the target PostScript interpreter is known to support only LanguageLevel 1.

When a PDF content stream is translated into the PostScript language, any Do operation that references a PostScript XObject is replaced by the contents of the XObject stream itself. The stream is copied without interpretation. The PostScript fragment may use Type 1 and TrueType fonts listed in the Font subdictionary of the current resource dictionary (see Section 3.7.2, “Resource Dictionaries”), accessing them by their BaseFont names using the PostScript findfont operator. The fragment may not use other types of fonts listed in the Font subdictionary. It should not reference the PostScript definitions corresponding to PDF procedure sets (see Section 10.1, “Procedure Sets”), which are subject to change.

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint