pub struct PdfPageTextSegment<'a> { /* private fields */ }Expand description
A single rectangular text segment in a PdfPageTextSegments collection.
Pdfium automatically merges smaller text boxes into larger text segments if all
enclosed characters are on the same line and share the same font settings. The number of
individual PdfPageTextObject objects on the page may be much larger than the number of
text segments.
Implementations
sourceimpl<'a> PdfPageTextSegment<'a>
impl<'a> PdfPageTextSegment<'a>
sourcepub fn bounds(&self) -> PdfRect
pub fn bounds(&self) -> PdfRect
Returns the bounding box of this PdfPageTextSegment.
sourcepub fn width(&self) -> PdfPoints
pub fn width(&self) -> PdfPoints
Returns the width of this PdfPageTextSegment.
sourcepub fn height(&self) -> PdfPoints
pub fn height(&self) -> PdfPoints
Returns the height of this PdfPageTextSegment.
sourcepub fn is_inside_rect(&self, rect: &PdfRect) -> bool
pub fn is_inside_rect(&self, rect: &PdfRect) -> bool
Returns true if the bounds of this PdfPageTextSegment lie entirely within the given rectangle.
sourcepub fn does_overlap_rect(&self, rect: &PdfRect) -> bool
pub fn does_overlap_rect(&self, rect: &PdfRect) -> bool
Returns true if the bounds of this PdfPageTextSegment lie at least partially within
the given rectangle.
sourcepub fn text(&self) -> String
pub fn text(&self) -> String
Returns all characters that lie within the bounds of this PdfPageTextSegment in the
containing PdfPage, in the order in which they are defined in the document.
In complex custom layouts, the order in which characters are defined in the document and the order in which they appear visually during rendering (and thus the order in which they are read by a user) may not necessarily match.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for PdfPageTextSegment<'a>
impl<'a> !Send for PdfPageTextSegment<'a>
impl<'a> !Sync for PdfPageTextSegment<'a>
impl<'a> Unpin for PdfPageTextSegment<'a>
impl<'a> !UnwindSafe for PdfPageTextSegment<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more