PdfPageTextSegments

Struct PdfPageTextSegments 

Source
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>

Source

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.

Source

pub fn is_empty(&self) -> bool

Returns true if this PdfPageTextSegments collection is empty.

Source

pub fn as_range(&self) -> Range<PdfPageTextSegmentIndex>

Returns a Range from 0..(number of segments) for this PdfPageTextSegments collection.

Source

pub fn as_range_inclusive(&self) -> RangeInclusive<PdfPageTextSegmentIndex>

Returns an inclusive Range from 0..=(number of segments - 1) for this PdfPageTextSegments collection.

Source

pub fn get( &self, index: PdfPageTextSegmentIndex, ) -> Result<PdfPageTextSegment<'_>, PdfiumError>

Returns a single PdfPageTextSegment from this PdfPageTextSegments collection.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.