pub fn parse_object_stream_with_decryption(
stream_obj: &Object,
decryption_fn: Option<&dyn Fn(&[u8]) -> Result<Vec<u8>>>,
obj_num: u32,
gen_num: u32,
) -> Result<HashMap<u32, Object>>Expand description
Parse an object stream with optional decryption.
PDF Spec: Object streams (PDF 1.5+) can be encrypted like any other stream. The encryption must be applied before decompression.
§Arguments
stream_obj- The object stream object (must be a Stream with /Type /ObjStm)decryption_fn- Optional decryption function (from EncryptionHandler)obj_num- Object number (for encryption key derivation)gen_num- Generation number (for encryption key derivation)
§Returns
A HashMap mapping object numbers to their parsed objects.
§Errors
Returns an error if:
- The object is not a stream
- The stream is not a valid object stream (/Type /ObjStm)
- Required dictionary entries (/N, /First) are missing
- Stream decoding/decryption fails
- Object parsing fails