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

Safe HaskellNone

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
 

Instances

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

Instances

lastXRef :: MonadIO m => RIS -> PdfE m XRefSource

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 DictSource

Read trailer for the xref

lookupTableEntrySource

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

lookupStreamEntrySource

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 BoolSource

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