Skip to main content

TextSection

Struct TextSection 

Source
pub struct TextSection<'f, 'p> { /* private fields */ }
Expand description

A text section that is drawn on an area of a PDF layer.

Implementations§

Source§

impl<'f, 'p> TextSection<'f, 'p>

Source

pub fn add_newline(&mut self) -> bool

Tries to add a new line and returns true if the area was large enough to fit the new line.

Source

pub fn print_str( &mut self, s: impl AsRef<str>, style: Style, ) -> Result<(), Error>

Prints the given string with the given style.

The font cache for this text section must contain the PDF font for the given style.

Adds a clickable link with the given text, URI, and style.

The font cache for this text section must contain the PDF font for the given style.

Trait Implementations§

Source§

impl<'f, 'p> Drop for TextSection<'f, 'p>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'f, 'p> Freeze for TextSection<'f, 'p>

§

impl<'f, 'p> !RefUnwindSafe for TextSection<'f, 'p>

§

impl<'f, 'p> !Send for TextSection<'f, 'p>

§

impl<'f, 'p> !Sync for TextSection<'f, 'p>

§

impl<'f, 'p> Unpin for TextSection<'f, 'p>

§

impl<'f, 'p> !UnwindSafe for TextSection<'f, 'p>

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<U, T> ToOwnedObj<U> for T
where U: FromObjRef<T>,

Source§

fn to_owned_obj(&self, data: FontData<'_>) -> U

Convert this type into T, using the provided data to resolve any offsets.
Source§

impl<U, T> ToOwnedTable<U> for T
where U: FromTableRef<T>,

Source§

fn to_owned_table(&self) -> U

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.