pub struct PdfPageTextSegments<'a> { /* private fields */ }Expand description
A collection of all the distinct rectangular areas of a single PdfPage occupied by spans of text that share a common text style.
Pdfium automatically merges smaller text boxes into larger ones if all enclosed characters are on the same line and share the same font settings.
Implementations§
Source§impl<'a> PdfPageTextSegments<'a>
impl<'a> PdfPageTextSegments<'a>
Sourcepub fn len(&self) -> PdfPageTextSegmentIndex
pub fn len(&self) -> PdfPageTextSegmentIndex
Returns the number of distinct rectangular areas occupied by text in the containing PdfPage.
Pdfium automatically merges smaller text boxes into larger ones if all enclosed characters are on the same line and share the same font settings. The number of rectangular text segments returned by this function therefore indicates the minimum number of spans of text that share text styles on the page. The number of individual PdfPageTextObject objects on the page may be much larger than the number of text segments.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if this PdfPageTextSegments collection is empty.
Sourcepub fn as_range(&self) -> Range<PdfPageTextSegmentIndex>
pub fn as_range(&self) -> Range<PdfPageTextSegmentIndex>
Returns a Range from 0..(number of segments) for this PdfPageTextSegments collection.
Sourcepub fn as_range_inclusive(&self) -> RangeInclusive<PdfPageTextSegmentIndex>
pub fn as_range_inclusive(&self) -> RangeInclusive<PdfPageTextSegmentIndex>
Returns an inclusive Range from 0..=(number of segments - 1) for this
PdfPageTextSegments collection.
Sourcepub fn get(
&self,
index: PdfPageTextSegmentIndex,
) -> Result<PdfPageTextSegment<'_>, PdfiumError>
pub fn get( &self, index: PdfPageTextSegmentIndex, ) -> Result<PdfPageTextSegment<'_>, PdfiumError>
Returns a single PdfPageTextSegment from this PdfPageTextSegments collection.
Sourcepub fn iter(&self) -> PdfPageTextSegmentsIterator<'_> ⓘ
pub fn iter(&self) -> PdfPageTextSegmentsIterator<'_> ⓘ
Returns an iterator over all the text segments in this 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.
Auto Trait Implementations§
impl<'a> Freeze for PdfPageTextSegments<'a>
impl<'a> !RefUnwindSafe for PdfPageTextSegments<'a>
impl<'a> !Send for PdfPageTextSegments<'a>
impl<'a> !Sync for PdfPageTextSegments<'a>
impl<'a> Unpin for PdfPageTextSegments<'a>
impl<'a> !UnwindSafe for PdfPageTextSegments<'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