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> { ... }
}