Why does `save` mandate a `BufWriter`?
In save:
https://github.com/fschutt/printpdf/blob/097defa25d5d5a14520498043a30979fe4af8bba/src/types/pdf_document.rs#L343
It doesn´t seem to actually need it to be a BufWriter since it just calls save_to in lopdf which takes a Write.
It's supposed to prevent you from passing in a File handle because then Rust would write the PDF character-by-character, requiring a syscall for every single character. I once benchmarked this crate and saving the file took the largest amount of time, that's why BufWriter is required.
Of course you could also use an io::Cursor<Vec<u8>> to write the file to memory first, then flush the memory to disk, but it's just to prevent the default (passing in a File handle directly).