pdf-toolbox-core-0.1.2: A collection of tools for processing PDF files.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Pdf.Core.Stream

Description

Stream related tools

Synopsis

Documentation

data StreamFilter Source #

Stream filter

knownFilters :: [StreamFilter] Source #

All stream filters implemented by the toolbox

Right now it contains only FlateDecode filter

readStream :: InputStream ByteString -> Int64 -> IO Stream Source #

Read Stream from stream

We need to pass current position here to calculate stream data offset

rawStreamContent Source #

Arguments

:: Buffer 
-> Int

stream length

-> Int64

stream offset The payload is offset of stream data

-> IO (InputStream ByteString) 

Raw stream content. Filters are not applyed

The InputStream returned is valid only until the next bufferSeek

Note: "Length" could be an indirect object, but we don't want to read indirect objects here. So we require length to be provided

decodedStreamContent Source #

Arguments

:: Buffer 
-> [StreamFilter] 
-> (InputStream ByteString -> IO (InputStream ByteString))

decryptor

-> Int

stream length

-> Stream

stream with offset

-> IO (InputStream ByteString) 

Decoded stream content

The InputStream is valid only until the next bufferSeek

Note: "Length" could be an indirect object, that is why we cann't read it ourself

decodeStream :: [StreamFilter] -> Stream -> InputStream ByteString -> IO (InputStream ByteString) Source #

Decode stream content

It should be already decrypted

The InputStream is valid only until the next bufferSeek