The basic design of how graphics are represented in PDF is very similar to that of PostScript, except for the use of transparency, which was added in PDF 1.4. PDF graphics use a
device-independent Cartesian coordinate system to describe the surface of a page. A PDF page description can use a
matrix to
scale,
rotate, or
skew graphical elements. A key concept in PDF is that of the
graphics state, which is a collection of graphical parameters that may be changed, saved, and restored by a
page description. PDF has (as of version 2.0) 25 graphics state properties, of which some of the most important are: • The
current transformation matrix (CTM), which determines the coordinate system • The
clipping path • The
color space • The
alpha constant, which is a key component of transparency •
Black point compensation control (introduced in PDF 2.0)
Vector graphics As in PostScript, vector graphics in PDF are constructed with
paths. Paths are usually composed of lines and cubic
Bézier curves, but can also be constructed from the outlines of text. Unlike PostScript, PDF does not allow a single path to mix text outlines with lines and curves. Paths can be stroked, filled, fill then stroked, or used for
clipping. Strokes and fills can use any color set in the graphics state, including
patterns. PDF supports several types of patterns. The simplest is the
tiling pattern in which a piece of artwork is specified to be drawn repeatedly. This may be a
colored tiling pattern, with the colors specified in the pattern object, or an
uncolored tiling pattern, which defers color specification to the time the pattern is drawn. Beginning with PDF 1.3 there is also a
shading pattern, which draws continuously varying colors. There are seven types of shading patterns of which the simplest are the
axial shading (Type 2) and
radial shading (Type 3).
Raster images Raster images in PDF (called
Image XObjects) are represented by dictionaries with an associated stream. The dictionary describes the properties of the image, and the stream contains the image data. (Less commonly, small raster images may be embedded directly in a page description as an
inline image.) Images are typically
filtered for compression purposes. Image filters supported in PDF include the following general-purpose filters: •
ASCII85Decode, a filter used to put the stream into 7-bit ASCII, •
ASCIIHexDecode, similar to ASCII85Decode but less compact, •
FlateDecode, a commonly used filter based on the
deflate algorithm defined in (deflate is also used in the
gzip,
PNG, and
zip file formats among others); introduced in PDF 1.2; it can use one of two groups of predictor functions for more compact zlib/deflate compression:
Predictor 2 from the
TIFF 6.0 specification and predictors (filters) from the
PNG specification (), •
LZWDecode, a filter based on
LZW Compression; it can use one of two groups of predictor functions for more compact LZW compression:
Predictor 2 from the TIFF 6.0 specification and predictors (filters) from the PNG specification, •
RunLengthDecode, a simple compression method for streams with repetitive data using the
run-length encoding algorithm and the image-specific filters, •
DCTDecode, a
lossy filter based on the
JPEG standard, •
CCITTFaxDecode, a lossless
bi-level (black/white) filter based on the Group 3 or
Group 4 CCITT (ITU-T)
fax compression standard defined in ITU-T
T.4 and T.6, •
JBIG2Decode, a lossy or
lossless bi-level (black/white) filter based on the
JBIG2 standard, introduced in PDF 1.4, and •
JPXDecode, a lossy or lossless filter based on the
JPEG 2000 standard, introduced in PDF 1.5. Normally all image content in a PDF is embedded in the file. But PDF allows image data to be stored in external files by the use of
external streams or
Alternate Images. Standardized subsets of PDF, including
PDF/A and
PDF/X, prohibit these features.
Text Text in PDF is represented by
text elements in page content streams. A text element specifies that
characters should be drawn at certain positions. The characters are specified using the
encoding of a selected
font resource. A font object in PDF is a description of a digital
typeface. It may either describe the characteristics of a typeface, or it may include an embedded
font file. The latter case is called an
embedded font while the former is called an
unembedded font. The font files that may be embedded are based on widely used standard digital font formats:
Type 1 (and its compressed variant CFF),
TrueType, and (beginning with PDF 1.6)
OpenType. Additionally PDF supports the Type 3 variant in which the components of the font are described by PDF graphic operators. Fourteen typefaces, known as the
standard 14 fonts or
base fourteen fonts, have a special significance in PDF documents: •
Times (v3) (in regular, italic, bold, and bold italic) •
Courier (in regular, oblique, bold and bold oblique) •
Helvetica (v3) (in regular, oblique, bold and bold oblique) •
Symbol •
Zapf Dingbats These fonts, or suitable substitute fonts with the same metrics, should be available in most PDF readers, but they are not
guaranteed to be available in the reader, and may only display correctly if the system has them installed. Fonts may be substituted if they are not embedded in a PDF. Within text strings, characters are shown using
character codes (integers) that map to glyphs in the current font using an
encoding. There are several predefined encodings, including
WinAnsi,
MacRoman, and many encodings for East Asian languages and a font can have its own built-in encoding. (Although the WinAnsi and MacRoman encodings are derived from the historical properties of the
Windows and
Macintosh operating systems, fonts using these encodings work equally well on any platform.) PDF can specify a predefined encoding to use, the font's built-in encoding or provide a lookup table of differences to a predefined or built-in encoding (not recommended with TrueType fonts). The concept of a transparency group in PDF specification is independent of existing notions of "group" or "layer" in applications such as Adobe Illustrator. Those groupings reflect logical relationships among objects that are meaningful when editing those objects, but they are not part of the imaging model. == Additional features ==