pub struct GraphicsContext { /* private fields */ }Implementations§
Source§impl GraphicsContext
impl GraphicsContext
pub fn new() -> Self
pub fn move_to(&mut self, x: f64, y: f64) -> &mut Self
pub fn line_to(&mut self, x: f64, y: f64) -> &mut Self
pub fn curve_to( &mut self, x1: f64, y1: f64, x2: f64, y2: f64, x3: f64, y3: f64, ) -> &mut Self
pub fn rect(&mut self, x: f64, y: f64, width: f64, height: f64) -> &mut Self
pub fn circle(&mut self, cx: f64, cy: f64, radius: f64) -> &mut Self
pub fn close_path(&mut self) -> &mut Self
pub fn stroke(&mut self) -> &mut Self
pub fn fill(&mut self) -> &mut Self
pub fn fill_stroke(&mut self) -> &mut Self
pub fn set_stroke_color(&mut self, color: Color) -> &mut Self
pub fn set_fill_color(&mut self, color: Color) -> &mut Self
pub fn set_line_width(&mut self, width: f64) -> &mut Self
pub fn set_line_cap(&mut self, cap: LineCap) -> &mut Self
pub fn set_line_join(&mut self, join: LineJoin) -> &mut Self
Sourcepub fn set_opacity(&mut self, opacity: f64) -> &mut Self
pub fn set_opacity(&mut self, opacity: f64) -> &mut Self
Set the opacity for both fill and stroke operations (0.0 to 1.0)
Sourcepub fn set_fill_opacity(&mut self, opacity: f64) -> &mut Self
pub fn set_fill_opacity(&mut self, opacity: f64) -> &mut Self
Set the fill opacity (0.0 to 1.0)
Sourcepub fn set_stroke_opacity(&mut self, opacity: f64) -> &mut Self
pub fn set_stroke_opacity(&mut self, opacity: f64) -> &mut Self
Set the stroke opacity (0.0 to 1.0)
pub fn save_state(&mut self) -> &mut Self
pub fn restore_state(&mut self) -> &mut Self
pub fn translate(&mut self, tx: f64, ty: f64) -> &mut Self
pub fn scale(&mut self, sx: f64, sy: f64) -> &mut Self
pub fn rotate(&mut self, angle: f64) -> &mut Self
pub fn transform( &mut self, a: f64, b: f64, c: f64, d: f64, e: f64, f: f64, ) -> &mut Self
pub fn rectangle( &mut self, x: f64, y: f64, width: f64, height: f64, ) -> &mut Self
pub fn draw_image( &mut self, image_name: &str, x: f64, y: f64, width: f64, height: f64, ) -> &mut Self
Sourcepub fn uses_transparency(&self) -> bool
pub fn uses_transparency(&self) -> bool
Check if transparency is used (opacity != 1.0)
Sourcepub fn generate_graphics_state_dict(&self) -> Option<String>
pub fn generate_graphics_state_dict(&self) -> Option<String>
Generate the graphics state dictionary for transparency
Sourcepub fn fill_color(&self) -> Color
pub fn fill_color(&self) -> Color
Get the current fill color
Sourcepub fn stroke_color(&self) -> Color
pub fn stroke_color(&self) -> Color
Get the current stroke color
Sourcepub fn line_width(&self) -> f64
pub fn line_width(&self) -> f64
Get the current line width
Sourcepub fn fill_opacity(&self) -> f64
pub fn fill_opacity(&self) -> f64
Get the current fill opacity
Sourcepub fn stroke_opacity(&self) -> f64
pub fn stroke_opacity(&self) -> f64
Get the current stroke opacity
Sourcepub fn operations(&self) -> &str
pub fn operations(&self) -> &str
Get the operations string
Sourcepub fn begin_text(&mut self) -> &mut Self
pub fn begin_text(&mut self) -> &mut Self
Begin a text object
Sourcepub fn set_text_position(&mut self, x: f64, y: f64) -> &mut Self
pub fn set_text_position(&mut self, x: f64, y: f64) -> &mut Self
Set text position
Sourcepub fn render_table(&mut self, table: &Table) -> Result<()>
pub fn render_table(&mut self, table: &Table) -> Result<()>
Render a table
Sourcepub fn render_list(&mut self, list: &ListElement) -> Result<()>
pub fn render_list(&mut self, list: &ListElement) -> Result<()>
Render a list
Sourcepub fn render_column_layout(
&mut self,
layout: &ColumnLayout,
content: &ColumnContent,
x: f64,
y: f64,
height: f64,
) -> Result<()>
pub fn render_column_layout( &mut self, layout: &ColumnLayout, content: &ColumnContent, x: f64, y: f64, height: f64, ) -> Result<()>
Render column layout
Sourcepub fn set_line_dash_pattern(&mut self, pattern: LineDashPattern) -> &mut Self
pub fn set_line_dash_pattern(&mut self, pattern: LineDashPattern) -> &mut Self
Set line dash pattern
Sourcepub fn set_line_solid(&mut self) -> &mut Self
pub fn set_line_solid(&mut self) -> &mut Self
Set line dash pattern to solid (no dashes)
Sourcepub fn set_miter_limit(&mut self, limit: f64) -> &mut Self
pub fn set_miter_limit(&mut self, limit: f64) -> &mut Self
Set miter limit
Sourcepub fn set_rendering_intent(&mut self, intent: RenderingIntent) -> &mut Self
pub fn set_rendering_intent(&mut self, intent: RenderingIntent) -> &mut Self
Set rendering intent
Sourcepub fn set_flatness(&mut self, flatness: f64) -> &mut Self
pub fn set_flatness(&mut self, flatness: f64) -> &mut Self
Set flatness tolerance
Sourcepub fn apply_extgstate(&mut self, state: ExtGState) -> Result<&mut Self>
pub fn apply_extgstate(&mut self, state: ExtGState) -> Result<&mut Self>
Apply an ExtGState dictionary immediately
Sourcepub fn with_extgstate<F>(&mut self, builder: F) -> Result<&mut Self>
pub fn with_extgstate<F>(&mut self, builder: F) -> Result<&mut Self>
Create and apply a custom ExtGState
Sourcepub fn set_blend_mode(&mut self, mode: BlendMode) -> Result<&mut Self>
pub fn set_blend_mode(&mut self, mode: BlendMode) -> Result<&mut Self>
Set blend mode for transparency
Sourcepub fn set_alpha(&mut self, alpha: f64) -> Result<&mut Self>
pub fn set_alpha(&mut self, alpha: f64) -> Result<&mut Self>
Set alpha for both stroke and fill operations
Sourcepub fn set_alpha_stroke(&mut self, alpha: f64) -> Result<&mut Self>
pub fn set_alpha_stroke(&mut self, alpha: f64) -> Result<&mut Self>
Set alpha for stroke operations only
Sourcepub fn set_alpha_fill(&mut self, alpha: f64) -> Result<&mut Self>
pub fn set_alpha_fill(&mut self, alpha: f64) -> Result<&mut Self>
Set alpha for fill operations only
Sourcepub fn set_overprint_stroke(&mut self, overprint: bool) -> Result<&mut Self>
pub fn set_overprint_stroke(&mut self, overprint: bool) -> Result<&mut Self>
Set overprint for stroke operations
Sourcepub fn set_overprint_fill(&mut self, overprint: bool) -> Result<&mut Self>
pub fn set_overprint_fill(&mut self, overprint: bool) -> Result<&mut Self>
Set overprint for fill operations
Sourcepub fn set_stroke_adjustment(&mut self, adjustment: bool) -> Result<&mut Self>
pub fn set_stroke_adjustment(&mut self, adjustment: bool) -> Result<&mut Self>
Set stroke adjustment
Sourcepub fn set_smoothness(&mut self, smoothness: f64) -> Result<&mut Self>
pub fn set_smoothness(&mut self, smoothness: f64) -> Result<&mut Self>
Set smoothness tolerance
Sourcepub fn line_dash_pattern(&self) -> Option<&LineDashPattern>
pub fn line_dash_pattern(&self) -> Option<&LineDashPattern>
Get current line dash pattern
Sourcepub fn miter_limit(&self) -> f64
pub fn miter_limit(&self) -> f64
Get current miter limit
Sourcepub fn rendering_intent(&self) -> RenderingIntent
pub fn rendering_intent(&self) -> RenderingIntent
Get current rendering intent
Sourcepub fn smoothness(&self) -> f64
pub fn smoothness(&self) -> f64
Get current smoothness tolerance
Sourcepub fn extgstate_manager(&self) -> &ExtGStateManager
pub fn extgstate_manager(&self) -> &ExtGStateManager
Get the ExtGState manager (for advanced usage)
Sourcepub fn extgstate_manager_mut(&mut self) -> &mut ExtGStateManager
pub fn extgstate_manager_mut(&mut self) -> &mut ExtGStateManager
Get mutable ExtGState manager (for advanced usage)
Sourcepub fn generate_extgstate_resources(&self) -> Result<String>
pub fn generate_extgstate_resources(&self) -> Result<String>
Generate ExtGState resource dictionary for PDF
Sourcepub fn has_extgstates(&self) -> bool
pub fn has_extgstates(&self) -> bool
Check if any extended graphics states are defined
Sourcepub fn add_command(&mut self, command: &str)
pub fn add_command(&mut self, command: &str)
Add a command to the operations
Sourcepub fn clip(&mut self) -> &mut Self
pub fn clip(&mut self) -> &mut Self
Create clipping path from current path using non-zero winding rule
Sourcepub fn clip_even_odd(&mut self) -> &mut Self
pub fn clip_even_odd(&mut self) -> &mut Self
Create clipping path from current path using even-odd rule
Trait Implementations§
Source§impl Clone for GraphicsContext
impl Clone for GraphicsContext
Source§fn clone(&self) -> GraphicsContext
fn clone(&self) -> GraphicsContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more