pub struct PdfWriter { /* private fields */ }Implementations§
Source§impl PdfWriter
impl PdfWriter
pub fn new() -> Self
pub fn alloc(&mut self) -> Ref
Sourcepub fn object(&mut self, id: Ref, body: &str)
pub fn object(&mut self, id: Ref, body: &str)
Writes a plain indirect object: id 0 obj\n<body>\nendobj\n.
Sourcepub fn stream(&mut self, id: Ref, dict_extra: &str, data: &[u8])
pub fn stream(&mut self, id: Ref, dict_extra: &str, data: &[u8])
Writes an indirect stream object, uncompressed. dict_extra are
additional dictionary entries (e.g. /Length1 1234); /Length is
computed and added automatically.
Sourcepub fn compressed_stream(&mut self, id: Ref, dict_extra: &str, data: &[u8])
pub fn compressed_stream(&mut self, id: Ref, dict_extra: &str, data: &[u8])
Self::stream’s DEFLATE-compressed counterpart (ADR-016): adds
/Filter /FlateDecode and zlib-wraps data (RFC 1950 — what
/FlateDecode expects per PDF 32000-1 7.4.4) before writing. Used
for content streams, embedded font programs (FontFile2) and
ToUnicode CMaps — never for data that’s already compressed (e.g.
JPEG /DCTDecode samples), where re-deflating near-random bytes
wastes CPU for ~0 size benefit.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PdfWriter
impl RefUnwindSafe for PdfWriter
impl Send for PdfWriter
impl Sync for PdfWriter
impl Unpin for PdfWriter
impl UnsafeUnpin for PdfWriter
impl UnwindSafe for PdfWriter
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