Struct pdfium_render::paragraph::PdfStyledString
source · [−]pub struct PdfStyledString<'a> { /* private fields */ }Expand description
A single styled string in a PdfParagraph.
Implementations
sourceimpl<'a> PdfStyledString<'a>
impl<'a> PdfStyledString<'a>
sourcepub fn new(text: String, font: &'a PdfFont<'a>, font_size: PdfPoints) -> Self
pub fn new(text: String, font: &'a PdfFont<'a>, font_size: PdfPoints) -> Self
Creates a new PdfStyledString from the given arguments.
sourcepub fn from_text_object(text_object: &'a PdfPageTextObject<'a>) -> Self
pub fn from_text_object(text_object: &'a PdfPageTextObject<'a>) -> Self
Creates a new PdfStyledString from the given PdfPageTextObject.
sourcepub fn text(&self) -> &str
pub fn text(&self) -> &str
Returns the text in this PdfStyledString.
sourcepub fn font(&self) -> &PdfFont<'_>
pub fn font(&self) -> &PdfFont<'_>
Returns the PdfFont used to style this PdfStyledString.
sourcepub fn font_size(&self) -> PdfPoints
pub fn font_size(&self) -> PdfPoints
Returns the font size used to style this PdfStyledString.
sourcepub fn does_match_string_styling(&self, other: &PdfStyledString<'_>) -> bool
pub fn does_match_string_styling(&self, other: &PdfStyledString<'_>) -> bool
Returns true if the font and font size of this PdfStyledString is the same as
that of the given string.
sourcepub fn does_match_object_styling(&self, other: &PdfPageTextObject<'_>) -> bool
pub fn does_match_object_styling(&self, other: &PdfPageTextObject<'_>) -> bool
Returns true if the font and font size of this PdfStyledString is the same as
that of the given PdfPageTextObject.
sourcepub fn as_text_object(
&self,
document: &PdfDocument<'a>
) -> Result<PdfPageTextObject<'a>, PdfiumError>
pub fn as_text_object(
&self,
document: &PdfDocument<'a>
) -> Result<PdfPageTextObject<'a>, PdfiumError>
Creates a new PdfPageTextObject from this styled string, using the Pdfium bindings in the given document.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for PdfStyledString<'a>
impl<'a> !Send for PdfStyledString<'a>
impl<'a> !Sync for PdfStyledString<'a>
impl<'a> Unpin for PdfStyledString<'a>
impl<'a> !UnwindSafe for PdfStyledString<'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