pub fn save(
doc: &EditDoc<'_>,
opts: &SaveOptions,
out: &mut impl Write,
) -> Result<(), Error>Expand description
Write doc to out.
§Errors
Error::EncryptedSaveUnsupported when the document declares /Encrypt
but this reader never derived a key for it — an /Identity crypt filter,
or a handler we opened as pdfrum_crypt::SecurityHandler::Identity —
and remove_security was not set, because re-declaring a cipher over
plaintext would produce a file nothing could open. And Error::Io when
the sink refuses the bytes.
Damage in the input is not an error: an object that cannot be fetched is dropped from both the body and the cross-reference, exactly as the C++ writer drops it.