Drawing Operators
Overview
After thecolumn
elements, there will
be image
, imagemask
,
fill
, stroke
,
and textop
elements describing the graphical
content on the page. (The textop
elements are
only present if enabled with the -textops
option.)
These elements appear in the order in which the objects were drawn in the PDF content stream.
Images
Each placed image is represented by animage
element:
llx
, lly
,
urx
, ury
) is identical in
format to the word
bounding box. Units are
controlled by the -unit
option.
The image tag in the imagedata
attribute refers to
an imagedata
element in the resources
element. Multiple
images (on the same or different pages) can have the same image tag,
i.e., they can share the same image data. The same image data can be
drawn in different positions and/or with a different size.
Image masks
Image masks are monochrome (1-bit) bitmaps that are filled with a particular color:image
elements. There is an
additional color
child element (see the
description of color for word
elements).
Image mask data is a 1-bit image, with no inherent color. The same image mask data can be drawn in multiple places, at different sizes, and with different colors.
Fills
Fill operations are represented byfill
elements:
eo
" for the even-odd rule,
or "nzwn
" for the non-zero winding number rule.
The color
element is the same as used with words
and image masks, with one exception. For tiling pattern fills, with
the -nopatterns
command line option, the color will be:
Strokes
Stroke operations (poly-lines) are represented bystroke
elements:
-unit
option.
The line cap style is one of:
- 0: butt cap
- 1: round cap
- 2: projecting square cap
The line join style is one of:
- 0: miter join
- 1: round join
- 2: bevel join
The dash
element describes the line dash pattern.
There will be zero or more dashelem
children, each
with a value describing the length of a dash or gap. See the PDF (or
PostScript) reference manual for a more detailed explanation. A
plain, undashed line will have an empty dash pattern:
-unit
option.
The color
element is the same as for fill
operations, including the tiling pattern case.
Paths are described below.
Paths
Paths are used in bothfill
and stroke
elements. A path consists of one or
more subpaths. Each subpath starts with a moveto
,
which is followed by a sequence of lineto
and/or curveto
operations.
closed="true"
) or open
(closed="false"
). (For fill operations, all subpaths
will be implicitly closed, so the closed
attribute
can be ignored.)
All coordinates
(x
, y
, x1
, y1
, x2
, y2
, x3
, y3
)
are in the units specified by the -unit
option.
Text
Text drawing operations are represented bytextop
elements:
resources
element. The font size is in
the units specified with the -unit
option.
The coordinates (x
, y
) specify
the origin of the text, and are in the units specified by
the -unit
option.
The rotation angle is 0, 90, 180, or 270, indicating the text direction, in degrees counterclockwise from horizontal.
The mode is one of:
- 0: fill
- 1: stroke
- 2: fill and stroke
- 3: invisible
- 4: fill and clip
- 5: stroke and clip
- 6: fill, stroke, and clip
- 7: clip
The color
element is the same as used with word
elements.
The text
element contains the text of the word
(converted to Unicode).