Skip to main content

content_stream_data_with

Function content_stream_data_with 

Source
pub async fn content_stream_data_with<S: AsyncObjectSource>(
    src: S,
    s: &Stream,
) -> Result<Vec<u8>>
Expand description

Fetches and decodes one CONTENT stream — page /Contents, a form XObject, a Type3 CharProc, a pattern cell: anything whose bytes feed a content parser rather than an image decoder.

This is AsyncObjectSource::stream_data with one refusal in front: a stream whose trailing /Filter entry is an image codec (DCTDecode, JPXDecode) fails with Error::UnsupportedFilter instead of handing back the passthrough. decode_stream leaves those bytes ENCODED for the image layer (ISO 32000-1 7.4.9); a content parser fed the raw codestream would chew binary garbage into operators — typically a blank page with a clean report — so the refusal here is what turns the mislabelled stream into the same reported skip as any other filter this library cannot run. Same calling convention as page_content_with (src by value; see that function’s docs).