pub struct PdfRenderer { /* private fields */ }Expand description
PDF renderer
Implementations§
Source§impl PdfRenderer
impl PdfRenderer
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new PDF renderer with no extra font configuration.
Call PdfRenderer::with_font_config to supply a custom
FontConfig, or PdfRenderer::with_system_fonts to
auto-discover system fonts.
Sourcepub fn with_system_fonts() -> Self
pub fn with_system_fonts() -> Self
Create a new PDF renderer and populate its font configuration from standard system font directories.
Sourcepub fn with_font_config(self, font_config: FontConfig) -> Self
pub fn with_font_config(self, font_config: FontConfig) -> Self
Attach a custom FontConfig to this renderer.
Any existing configuration is replaced.
Sourcepub fn render_with_fo(
&self,
area_tree: &AreaTree,
fo_tree: &FoArena<'_>,
) -> Result<PdfDocument>
pub fn render_with_fo( &self, area_tree: &AreaTree, fo_tree: &FoArena<'_>, ) -> Result<PdfDocument>
Render an area tree and FO tree to a PDF document (with bookmark support)
Sourcepub fn render(&self, area_tree: &AreaTree) -> Result<PdfDocument>
pub fn render(&self, area_tree: &AreaTree) -> Result<PdfDocument>
Render an area tree to a PDF document
Sourcepub fn add_image_from_data(
&self,
doc: &mut PdfDocument,
image_data: &[u8],
) -> Result<usize>
pub fn add_image_from_data( &self, doc: &mut PdfDocument, image_data: &[u8], ) -> Result<usize>
Add an image to the document from raw image data
Sourcepub fn collect_images_public(
&self,
area_tree: &AreaTree,
doc: &mut PdfDocument,
image_map: &mut HashMap<AreaId, usize>,
) -> Result<()>
pub fn collect_images_public( &self, area_tree: &AreaTree, doc: &mut PdfDocument, image_map: &mut HashMap<AreaId, usize>, ) -> Result<()>
Public wrapper for collect_images (for parallel rendering)
Sourcepub fn collect_opacity_states_public(
&self,
area_tree: &AreaTree,
doc: &mut PdfDocument,
opacity_map: &mut HashMap<AreaId, usize>,
)
pub fn collect_opacity_states_public( &self, area_tree: &AreaTree, doc: &mut PdfDocument, opacity_map: &mut HashMap<AreaId, usize>, )
Public wrapper for collect_opacity_states (for parallel rendering)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PdfRenderer
impl RefUnwindSafe for PdfRenderer
impl Send for PdfRenderer
impl Sync for PdfRenderer
impl Unpin for PdfRenderer
impl UnsafeUnpin for PdfRenderer
impl UnwindSafe for PdfRenderer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().