Struct pdf_writer::Content [−][src]
pub struct Content { /* fields omitted */ }
Expand description
A builder for a content stream.
Implementations
Core methods.
Create a new content stream with the default buffer capacity (currently 1 KB).
Create a new content stream with the specified initial buffer capacity.
Start writing an arbitrary operation.
General graphics state.
w
: Set the stroke line width.
Panics if width
is negative.
J
: Set the line cap style.
j
: Set the line join style.
M
: Set the miter limit.
pub fn set_dash_pattern(
&mut self,
array: impl IntoIterator<Item = f32>,
phase: f32
) -> &mut Self
pub fn set_dash_pattern(
&mut self,
array: impl IntoIterator<Item = f32>,
phase: f32
) -> &mut Self
d
: Set the line dash pattern.
ri
: Set the color rendering intent to the parameter. PDF 1.1+.
i
: Set the flatness tolerance in device pixels.
Panics if tolerance
is negative or larger than 100.
gs
: Set the parameters from an ExtGState
dictionary. PDF 1.2+.
Special graphics state.
q
: Save the graphics state on the stack.
Q
: Restore the graphics state from the stack.
Path construction.
c
: Append a cubic Bézier segment to (x3, y3) with (x1, y1), (x2, y2)
as control points.
v
: Append a cubic Bézier segment to (x3, y3) with (x2, y2) as control
point.
y
: Append a cubic Bézier segment to (x3, y3) with (x1, y1) as control
point.
h
: Close the current subpath with a straight line.
Path painting.
s
: Close the current path and then stroke it.
f
: Fill the current path using the nonzero winding number rule.
f*
: Fill the current path using the even-odd rule.
B
: Fill the current path using the nonzero winding number rule and
then stroke it.
B*
: Fill the current path using the even-odd rule and then stroke it.
b
: Close the current path, fill it using the nonzero winding number
rule and then stroke it.
b*
: Close the current path, fill it using the even-odd rule and then
stroke it.
Clipping paths.
W
: Intersect the current clipping path with the current path using the
nonzero winding number rule.
W*
: Intersect the current clipping path with the current path using
the even-odd rule.
Text objects.
Text state.
Tc
: Set the character spacing.
Tw
: Set the word spacing.
Tz
: Set the horizontal scaling.
TL
: Set the leading.
Tr
: Set the text rendering mode.
Text positioning.
Td
: Move to the start of the next line.
TD
: Move to the start of the next line and set the text state’s
leading parameter to -y
.
T*
: Move to the start of the next line, determing the vertical offset
through the text state’s leading parameter.
Text showing.
Tj
: Show text.
The encoding of the text depends on the font.
'
: Move to the next line and show text.
"
: Move to the next line, show text and set the text state’s word and
character spacing.
TJ
: Show text with individual glyph positioning.
Type 3 fonts.
These operators are only allowed in Type 3 CharProcs.
d0
: Starts a Type 3 glyph that contains color information.
wx
defines the glyph’s widthwy
is set to 0.0 automatically
d1
: Starts a Type 3 glyph that contains only shape information.
wx
defines the glyph’s widthwy
is set to 0.0 automaticallyll_x
andll_y
define the lower-left corner of the glyph bounding boxur_x
andur_y
define the upper-right corner of the glyph bounding box
Color.
CS
: Set the stroke color space to the parameter. PDF 1.1+.
The parameter must be the name of a parameter-less color space or of a color space dictionary within the current resource dictionary.
cs
: Set the fill color space to the parameter. PDF 1.1+.
The parameter must be the name of a parameter-less color space or of a color space dictionary within the current resource dictionary.
SCN
: Set the stroke color to the parameter within the current color
space. PDF 1.2+.
pub fn set_stroke_pattern(
&mut self,
tint: impl IntoIterator<Item = f32>,
name: Name<'_>
) -> &mut Self
pub fn set_stroke_pattern(
&mut self,
tint: impl IntoIterator<Item = f32>,
name: Name<'_>
) -> &mut Self
SCN
: Set the stroke pattern. PDF 1.2+.
The name
parameter is the name of a pattern. If this is an uncolored
pattern, a tint color in the current Pattern
base color space must be
given, otherwise, the color
iterator shall remain empty.
scn
: Set the fill color to the parameter within the current color
space. PDF 1.2+.
pub fn set_fill_pattern(
&mut self,
tint: impl IntoIterator<Item = f32>,
name: Name<'_>
) -> &mut Self
pub fn set_fill_pattern(
&mut self,
tint: impl IntoIterator<Item = f32>,
name: Name<'_>
) -> &mut Self
scn
: Set the fill pattern. PDF 1.2+.
The name
parameter is the name of a pattern. If this is an uncolored
pattern, a tint color in the current Pattern
base color space must be
given, otherwise, the color
iterator shall remain empty.
G
: Set the stroke color to the parameter and the color space to
DeviceGray
.
g
: Set the fill color to the parameter and the color space to
DeviceGray
.
RG
: Set the stroke color to the parameter and the color space to
DeviceRGB
.
rg
: Set the fill color to the parameter and the color space to
DeviceRGB
.
K
: Set the stroke color to the parameter and the color space to
DeviceCMYK
.
Shading patterns.
XObjects.
Compatibility.
BX
: Begin a compatability section.
EX
: End a compatability section.