pub struct AppearanceStreamBuilder { /* private fields */ }Expand description
Builds content stream operations for annotation appearance streams.
All coordinates are in the Form XObject’s local coordinate system, where (0,0) is the bottom-left of the annotation rectangle.
Implementations§
Source§impl AppearanceStreamBuilder
impl AppearanceStreamBuilder
Sourcepub fn new(width: f64, height: f64) -> Self
pub fn new(width: f64, height: f64) -> Self
Create a new builder for an appearance stream with the given dimensions.
Sourcepub fn save_state(&mut self) -> &mut Self
pub fn save_state(&mut self) -> &mut Self
Save the current graphics state.
Sourcepub fn restore_state(&mut self) -> &mut Self
pub fn restore_state(&mut self) -> &mut Self
Restore the graphics state.
Sourcepub fn set_fill_color(&mut self, color: &AppearanceColor) -> &mut Self
pub fn set_fill_color(&mut self, color: &AppearanceColor) -> &mut Self
Set the fill color (RGB).
Sourcepub fn set_stroke_color(&mut self, color: &AppearanceColor) -> &mut Self
pub fn set_stroke_color(&mut self, color: &AppearanceColor) -> &mut Self
Set the stroke color (RGB).
Sourcepub fn set_line_width(&mut self, width: f64) -> &mut Self
pub fn set_line_width(&mut self, width: f64) -> &mut Self
Set the line width for stroked paths.
Sourcepub fn set_dash_pattern(&mut self, dash: &[f64], phase: f64) -> &mut Self
pub fn set_dash_pattern(&mut self, dash: &[f64], phase: f64) -> &mut Self
Set the dash pattern for stroked paths.
Sourcepub fn curve_to(
&mut self,
x1: f64,
y1: f64,
x2: f64,
y2: f64,
x3: f64,
y3: f64,
) -> &mut Self
pub fn curve_to( &mut self, x1: f64, y1: f64, x2: f64, y2: f64, x3: f64, y3: f64, ) -> &mut Self
Cubic bezier curve.
Sourcepub fn close_path(&mut self) -> &mut Self
pub fn close_path(&mut self) -> &mut Self
Close the current subpath.
Sourcepub fn fill_and_stroke(&mut self) -> &mut Self
pub fn fill_and_stroke(&mut self) -> &mut Self
Fill then stroke the current path.
Sourcepub fn close_fill_and_stroke(&mut self) -> &mut Self
pub fn close_fill_and_stroke(&mut self) -> &mut Self
Close, fill and stroke.
Sourcepub fn filled_rect(&mut self, color: &AppearanceColor) -> &mut Self
pub fn filled_rect(&mut self, color: &AppearanceColor) -> &mut Self
Add a filled rectangle covering the full annotation area.
Sourcepub fn stroked_rect(
&mut self,
color: &AppearanceColor,
line_width: f64,
) -> &mut Self
pub fn stroked_rect( &mut self, color: &AppearanceColor, line_width: f64, ) -> &mut Self
Add a stroked rectangle (border) inside the annotation area.
Sourcepub fn filled_stroked_rect(
&mut self,
fill: &AppearanceColor,
stroke: &AppearanceColor,
line_width: f64,
) -> &mut Self
pub fn filled_stroked_rect( &mut self, fill: &AppearanceColor, stroke: &AppearanceColor, line_width: f64, ) -> &mut Self
Draw a filled and stroked rectangle.
Sourcepub fn ellipse(&mut self) -> &mut Self
pub fn ellipse(&mut self) -> &mut Self
Draw an ellipse (circle if width == height) using cubic bezier approximation.
Sourcepub fn line(&mut self, x1: f64, y1: f64, x2: f64, y2: f64) -> &mut Self
pub fn line(&mut self, x1: f64, y1: f64, x2: f64, y2: f64) -> &mut Self
Draw a line between two points in local coordinates.
Sourcepub fn text(
&mut self,
text: &str,
font_name: &str,
font_size: f64,
x: f64,
y: f64,
color: &AppearanceColor,
) -> &mut Self
pub fn text( &mut self, text: &str, font_name: &str, font_size: f64, x: f64, y: f64, color: &AppearanceColor, ) -> &mut Self
Add text to the appearance stream.
Sourcepub fn ops_push_raw(&mut self, op: Operation) -> &mut Self
pub fn ops_push_raw(&mut self, op: Operation) -> &mut Self
Push a raw operation (for advanced use cases like ExtGState references).
Auto Trait Implementations§
impl Freeze for AppearanceStreamBuilder
impl RefUnwindSafe for AppearanceStreamBuilder
impl Send for AppearanceStreamBuilder
impl Sync for AppearanceStreamBuilder
impl Unpin for AppearanceStreamBuilder
impl UnsafeUnpin for AppearanceStreamBuilder
impl UnwindSafe for AppearanceStreamBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more