Lopdf: Rust library for PDF document manipulation
github.com
github.com
You can write a PDF in notepad, or every text editor, and, if you know your postscript, it isn’t that bad of an experience if you forget about modern features, except for that table of contents at the end of the file.
(For the record, I had to deal with text encodings in PDFs, and yes, it was a pain)
Only support one type of font embedding, with a single encoding (make everything utf-8) : it won’t change anything noticeable regarding the file size, and will greatly help at least parsing text.
I’ve only dealt with text parsing, so that’s the only easy improvement i see, but i’m pretty sure following the same logic on graphic content should be possible.
Sidenote : It seems the PDF/A format open yet the specification is kept behind a paywall ????
let content = Content {
operations: vec![
Operation::new("BT", vec![]),
Operation::new("Tf", vec!["F1".into(), 48.into()]),
Operation::new("Td", vec![100.into(), 600.into()]),
Operation::new("Tj", vec![Object::string_literal("Hello World!")]),
Operation::new("ET", vec![]),
],
};[1] "PDF Reference, Sixth Edition, version 1.7" at https://www.adobe.com/devnet/pdf/pdf_reference_archive.html
PDF is not exactly guaranteed to be portable- and is a format that needs to be dumped by anyone who cares about a global portability.