pub struct PdfText {
pub id: ElementId,
pub content: TextContent,
pub path: ElementPath,
}Expand description
Strongly-typed text element with DOM capabilities.
Fields§
§id: ElementId§content: TextContent§path: ElementPathImplementations§
Source§impl PdfText
impl PdfText
pub fn id(&self) -> ElementId
pub fn text(&self) -> &str
pub fn bbox(&self) -> Rect
pub fn font_name(&self) -> &str
pub fn font_size(&self) -> f32
pub fn is_bold(&self) -> bool
pub fn is_italic(&self) -> bool
pub fn color(&self) -> Color
Sourcepub fn set_value(&mut self, new_text: impl Into<String>)
pub fn set_value(&mut self, new_text: impl Into<String>)
Set text content (alias for set_text(), Python-friendly).
Sourcepub fn starts_with(&self, prefix: &str) -> bool
pub fn starts_with(&self, prefix: &str) -> bool
Check if the text starts with a prefix.
Sourcepub fn rotation_degrees(&self) -> Option<f32>
pub fn rotation_degrees(&self) -> Option<f32>
Get the rotation angle in degrees if available.
Sourcepub fn rotation_radians(&self) -> Option<f32>
pub fn rotation_radians(&self) -> Option<f32>
Get the rotation angle in radians if available.
Sourcepub fn matrix(&self) -> Option<[f32; 6]>
pub fn matrix(&self) -> Option<[f32; 6]>
Get the transformation matrix [a, b, c, d, e, f] if available.
Sourcepub fn is_rotated(&self) -> bool
pub fn is_rotated(&self) -> bool
Check if this text is rotated (non-zero rotation).
Sourcepub fn set_matrix(&mut self, matrix: [f32; 6])
pub fn set_matrix(&mut self, matrix: [f32; 6])
Set the transformation matrix.
Sourcepub fn set_origin(&mut self, origin: Point)
pub fn set_origin(&mut self, origin: Point)
Set the origin point.
Sourcepub fn set_rotation(&mut self, degrees: f32)
pub fn set_rotation(&mut self, degrees: f32)
Set the rotation angle in degrees.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PdfText
impl RefUnwindSafe for PdfText
impl Send for PdfText
impl Sync for PdfText
impl Unpin for PdfText
impl UnsafeUnpin for PdfText
impl UnwindSafe for PdfText
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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