Struct pdf_min::page::Page

source ·
pub struct Page {
    pub width: i16,
    pub height: i16,
    pub os: Vec<u8>,
    pub ts: Vec<u8>,
    pub text: Vec<u8>,
    pub x: i16,
    pub y: i16,
    pub sup: i16,
    pub fonts: BTreeSet<usize>,
    pub xobjs: BTreeSet<usize>,
    /* private fields */
}
Expand description

Fields§

§width: i16

Page width.

§height: i16

Page height.

§os: Vec<u8>

Output buffer.

§ts: Vec<u8>

Text stream.

§text: Vec<u8>

Current text buffer.

§x: i16

Current line position ( from left of page ).

§y: i16

Current line position ( from bottom of page ).

§sup: i16

Current super

§fonts: BTreeSet<usize>

Set of font obj numbers used by page.

§xobjs: BTreeSet<usize>

Set of other obj numbers used by page.

Implementations§

source§

impl Page

source

pub fn goto(&mut self, x: i16, y: i16)

Start a new line ( absolute position ).

source

pub fn td(&mut self, x: i16, y: i16)

Start a new line ( relative to previous line ).

source

pub fn text(&mut self, font: &dyn Font, size: i16, s: &str)

Append text ( encoded with font ).

source

pub fn finish(&mut self)

Finish page by appending self.ts to self.os enclosed by “BT” and “ET”.

source

pub fn line(&mut self, x0: f64, y0: f64, x1: f64, y1: f64)

Draw a line from (x0,y0) to (x1,y1)

source

pub fn rect(&mut self, x0: f64, y0: f64, x1: f64, y1: f64)

Draw a rectangle with corners (x0,y0) to (x1,y1)

source

pub fn set_sup(&mut self, sup: i16)

Set level of text on line.

Trait Implementations§

source§

impl Default for Page

source§

fn default() -> Page

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Page

§

impl Send for Page

§

impl Sync for Page

§

impl Unpin for Page

§

impl UnwindSafe for Page

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.