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 share the same baseline and the same font settings. The number of
individual PdfPageTextObject
objects on the page may be much larger than the number of
text segments.
Implementations§
Source§impl<'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.
Sourcepub fn chars(&self) -> Result<PdfPageTextChars<'_>, PdfiumError>
pub fn chars(&self) -> Result<PdfPageTextChars<'_>, PdfiumError>
Returns a collection of all the PdfPageTextChar 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> Freeze for PdfPageTextSegment<'a>
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§
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> 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 more