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

Safe HaskellNone
LanguageHaskell98

Pdf.Toolbox.Core.XRef

Description

Cross reference

Synopsis

Documentation

data XRef Source

Cross reference

Constructors

XRefTable Int64

Offset

XRefStream Int64 (Stream Int64)

Offset and stream with content offset

Instances

data XRefEntry Source

Entry in cross reference

Instances

data TableEntry Source

Entry in cross reference table

Constructors

TableEntry 

Fields

teOffset :: Int64
 
teGen :: Int
 
teIsFree :: Bool
 

data StreamEntry Source

Entry in cross reference stream

Constructors

StreamEntryFree Int Int

Object number and generation

StreamEntryUsed Int64 Int

Object offset (in bytes from the beginning of file) and generation

StreamEntryCompressed Int Int

Object number of object stream and index within the object stream

lastXRef :: MonadIO m => RIS -> PdfE m XRef Source

Find the last cross reference

prevXRef :: MonadIO m => RIS -> XRef -> PdfE m (Maybe XRef) Source

Find prev cross reference

trailer :: MonadIO m => RIS -> XRef -> PdfE m Dict Source

Read trailer for the xref

lookupTableEntry Source

Arguments

:: MonadIO m 
=> RIS

input stream to read from

-> Ref

indirect object to look for

-> PdfE m (Maybe TableEntry) 

Read xref entry for the indirect object from xref table

RIS position should point to the begining of the next line after "xref" keyword

lookupStreamEntry Source

Arguments

:: MonadIO m 
=> Stream IS

decoded xref stream content

-> Ref

indirect object

-> PdfE m (Maybe StreamEntry) 

Read xref entry for the indirect object from xref stream

See pdf1.7 spec: 7.5.8 Cross-Reference Streams

isTable :: MonadIO m => IS -> PdfE m Bool Source

Check whether the stream starts with "xref" keyword. The keyword iyself is consumed