Struct pdfium_render::page_text::PdfPageText
source · [−]pub struct PdfPageText<'a> { /* private fields */ }Expand description
The collection of Unicode characters visible in a single PdfPage.
Use the PdfPageText::all() function to easily return all characters in the containing PdfPage in the order in which they are defined in the PDF file.
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.
PdfPageText implements both the ToString and the Display traits.
Implementations
sourceimpl<'a> PdfPageText<'a>
impl<'a> PdfPageText<'a>
sourcepub fn len(&self) -> i32
pub fn len(&self) -> i32
Returns the total number of characters in all text boxes in the containing PdfPage.
The character count includes whitespace and newlines, and so may differ slightly
from the result of calling PdfPageText::all().len().
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if there are no characters in any text box collection in the containing PdfPage.
sourcepub fn all(&self) -> String
pub fn all(&self) -> String
Returns all characters that lie within 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 inside_rect(&self, rect: PdfRect) -> String
pub fn inside_rect(&self, rect: PdfRect) -> String
Returns all characters that lie within the bounds of the given PdfRect 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 for_object(&self, object: &PdfPageTextObject<'_>) -> String
pub fn for_object(&self, object: &PdfPageTextObject<'_>) -> String
Returns all characters assigned to the given PdfPageTextObject in this PdfPageText object.
Trait Implementations
sourceimpl<'a> Display for PdfPageText<'a>
impl<'a> Display for PdfPageText<'a>
sourceimpl<'a> Drop for PdfPageText<'a>
impl<'a> Drop for PdfPageText<'a>
sourcefn drop(&mut self)
fn drop(&mut self)
Closes the PdfPageText collection, releasing held memory.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for PdfPageText<'a>
impl<'a> !Send for PdfPageText<'a>
impl<'a> !Sync for PdfPageText<'a>
impl<'a> Unpin for PdfPageText<'a>
impl<'a> !UnwindSafe for PdfPageText<'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