Document

Trait Document 

Source
pub trait Document: Send + Sync {
Show 26 methods // Required methods fn dims(&self, index: usize) -> Option<(f32, f32)>; fn pages_count(&self) -> usize; fn toc(&mut self) -> Option<Vec<TocEntry>>; fn chapter<'a>( &mut self, offset: usize, toc: &'a [TocEntry], ) -> Option<(&'a TocEntry, f32)>; fn chapter_relative<'a>( &mut self, offset: usize, dir: CycleDir, toc: &'a [TocEntry], ) -> Option<&'a TocEntry>; fn words(&mut self, loc: Location) -> Option<(Vec<BoundedText>, usize)>; fn lines(&mut self, loc: Location) -> Option<(Vec<BoundedText>, usize)>; fn links(&mut self, loc: Location) -> Option<(Vec<BoundedText>, usize)>; fn images(&mut self, loc: Location) -> Option<(Vec<Boundary>, usize)>; fn pixmap( &mut self, loc: Location, scale: f32, samples: usize, ) -> Option<(Pixmap, usize)>; fn layout(&mut self, width: u32, height: u32, font_size: f32, dpi: u16); fn set_font_family(&mut self, family_name: &str, search_path: &str); fn set_margin_width(&mut self, width: i32); fn set_text_align(&mut self, text_align: TextAlign); fn set_line_height(&mut self, line_height: f32); fn set_hyphen_penalty(&mut self, hyphen_penalty: i32); fn set_stretch_tolerance(&mut self, stretch_tolerance: f32); fn set_ignore_document_css(&mut self, ignore: bool); fn title(&self) -> Option<String>; fn author(&self) -> Option<String>; fn metadata(&self, key: &str) -> Option<String>; fn is_reflowable(&self) -> bool; // Provided methods fn has_synthetic_page_numbers(&self) -> bool { ... } fn save(&self, _path: &str) -> Result<(), Error> { ... } fn preview_pixmap( &mut self, width: f32, height: f32, samples: usize, ) -> Option<Pixmap> { ... } fn resolve_location(&mut self, loc: Location) -> Option<usize> { ... }
}

Required Methods§

Source

fn dims(&self, index: usize) -> Option<(f32, f32)>

Source

fn pages_count(&self) -> usize

Source

fn toc(&mut self) -> Option<Vec<TocEntry>>

Source

fn chapter<'a>( &mut self, offset: usize, toc: &'a [TocEntry], ) -> Option<(&'a TocEntry, f32)>

Source

fn chapter_relative<'a>( &mut self, offset: usize, dir: CycleDir, toc: &'a [TocEntry], ) -> Option<&'a TocEntry>

Source

fn words(&mut self, loc: Location) -> Option<(Vec<BoundedText>, usize)>

Source

fn lines(&mut self, loc: Location) -> Option<(Vec<BoundedText>, usize)>

Source

fn images(&mut self, loc: Location) -> Option<(Vec<Boundary>, usize)>

Source

fn pixmap( &mut self, loc: Location, scale: f32, samples: usize, ) -> Option<(Pixmap, usize)>

Source

fn layout(&mut self, width: u32, height: u32, font_size: f32, dpi: u16)

Source

fn set_font_family(&mut self, family_name: &str, search_path: &str)

Source

fn set_margin_width(&mut self, width: i32)

Source

fn set_text_align(&mut self, text_align: TextAlign)

Source

fn set_line_height(&mut self, line_height: f32)

Source

fn set_hyphen_penalty(&mut self, hyphen_penalty: i32)

Source

fn set_stretch_tolerance(&mut self, stretch_tolerance: f32)

Source

fn set_ignore_document_css(&mut self, ignore: bool)

Source

fn title(&self) -> Option<String>

Source

fn author(&self) -> Option<String>

Source

fn metadata(&self, key: &str) -> Option<String>

Source

fn is_reflowable(&self) -> bool

Provided Methods§

Source

fn has_synthetic_page_numbers(&self) -> bool

Source

fn save(&self, _path: &str) -> Result<(), Error>

Source

fn preview_pixmap( &mut self, width: f32, height: f32, samples: usize, ) -> Option<Pixmap>

Source

fn resolve_location(&mut self, loc: Location) -> Option<usize>

Implementors§