pdf-toolbox-core-0.0.3.2: A collection of tools for processing PDF files.

Safe HaskellNone
LanguageHaskell98

Pdf.Toolbox.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

rawStreamContent Source

Arguments

:: MonadIO m 
=> RIS

random access input stream to read from

-> Int

stream length

-> Stream Int64

stream object to read content for. The payload is offset of stream data

-> PdfE m (Stream IS)

resulting stream object

Raw content of stream. Filters are not applyed

The IS is valid only until the next seek

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

:: MonadIO m 
=> RIS

random input stream to read from

-> [StreamFilter]

stream filters

-> (IS -> IO IS)

decryptor

-> Int

stream length

-> Stream Int64

stream with offset

-> PdfE m (Stream IS) 

Decoded stream content

The IS is valid only until the next seek

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

readStream :: MonadIO m => RIS -> PdfE m (Stream Int64) Source

Read Stream at the current position in the RIS

decodeStream :: MonadIO m => [StreamFilter] -> (IS -> IO IS) -> Stream IS -> PdfE m (Stream IS) Source

Decode stream content

The IS is valid only until the next RIS operation