pub enum TextElement {
Text(Vec<u8>),
Spacing(f32),
}Expand description
Represents a text element in a TJ array for ShowTextArray operations.
The TJ operator takes an array of strings and position adjustments, allowing fine control over character and word spacing.
§Example
use oxidize_pdf::parser::content::{TextElement, ContentOperation};
// TJ array: [(Hello) -50 (World)]
let tj_array = vec![
TextElement::Text(b"Hello".to_vec()),
TextElement::Spacing(-50.0), // Move left 50 units
TextElement::Text(b"World".to_vec()),
];
let op = ContentOperation::ShowTextArray(tj_array);Variants§
Text(Vec<u8>)
Text string to show
Spacing(f32)
Position adjustment in thousandths of text space units Negative values move to the right (decrease spacing)
Trait Implementations§
Source§impl Clone for TextElement
impl Clone for TextElement
Source§fn clone(&self) -> TextElement
fn clone(&self) -> TextElement
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TextElement
impl Debug for TextElement
Source§impl PartialEq for TextElement
impl PartialEq for TextElement
impl StructuralPartialEq for TextElement
Auto Trait Implementations§
impl Freeze for TextElement
impl RefUnwindSafe for TextElement
impl Send for TextElement
impl Sync for TextElement
impl Unpin for TextElement
impl UnwindSafe for TextElement
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