pub struct GraphicsState {
pub ctm: Matrix,
pub text_matrix: Matrix,
pub text_line_matrix: Matrix,
pub text_state: TextState,
pub fill_color: Vec<f64>,
pub stroke_color: Vec<f64>,
pub fill_color_space_components: u8,
pub stroke_color_space_components: u8,
}Expand description
Full graphics state for PDF content stream processing.
Fields§
§ctm: MatrixCurrent transformation matrix
text_matrix: MatrixText matrix (set by BT and text positioning operators)
text_line_matrix: MatrixText line matrix (set by text line positioning operators)
text_state: TextStateText state parameters
fill_color: Vec<f64>Fill color — original PDF color components (1=Gray, 3=RGB, 4=CMYK)
stroke_color: Vec<f64>Stroke color — original PDF color components
fill_color_space_components: u8Number of components in current non-stroking color space (1=Gray, 3=RGB, 4=CMYK)
stroke_color_space_components: u8Number of components in current stroking color space
Implementations§
Source§impl GraphicsState
impl GraphicsState
Sourcepub fn begin_text(&mut self)
pub fn begin_text(&mut self)
Begin text object: reset text matrix and text line matrix.
Sourcepub fn text_rendering_matrix(&self) -> Matrix
pub fn text_rendering_matrix(&self) -> Matrix
Get the combined text rendering matrix: text_state.font_size × text_matrix × CTM.
Sourcepub fn text_position(&self) -> (f64, f64)
pub fn text_position(&self) -> (f64, f64)
Get the current text position in user space.
Sourcepub fn effective_font_size(&self) -> f64
pub fn effective_font_size(&self) -> f64
Get the effective font size in user space.
Sourcepub fn translate_text(&mut self, tx: f64, ty: f64)
pub fn translate_text(&mut self, tx: f64, ty: f64)
Apply Td (translate text position).
Sourcepub fn set_text_matrix(
&mut self,
a: f64,
b: f64,
c: f64,
d: f64,
e: f64,
f: f64,
)
pub fn set_text_matrix( &mut self, a: f64, b: f64, c: f64, d: f64, e: f64, f: f64, )
Apply Tm (set text matrix directly).
Sourcepub fn advance_text(&mut self, displacement: f64)
pub fn advance_text(&mut self, displacement: f64)
Advance the text position after showing text (Tj displacement).
Trait Implementations§
Source§impl Clone for GraphicsState
impl Clone for GraphicsState
Source§fn clone(&self) -> GraphicsState
fn clone(&self) -> GraphicsState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GraphicsState
impl Debug for GraphicsState
Auto Trait Implementations§
impl Freeze for GraphicsState
impl RefUnwindSafe for GraphicsState
impl Send for GraphicsState
impl Sync for GraphicsState
impl Unpin for GraphicsState
impl UnsafeUnpin for GraphicsState
impl UnwindSafe for GraphicsState
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().