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

Safe HaskellNone
LanguageHaskell98

Pdf.Toolbox.Core.XRef

Description

Cross reference

Synopsis

Documentation

data XRef #

Cross reference

Constructors

XRefTable Int64

Offset

XRefStream Int64 (Stream Int64)

Offset and stream with content offset

Instances

Show XRef # 

Methods

showsPrec :: Int -> XRef -> ShowS #

show :: XRef -> String #

showList :: [XRef] -> ShowS #

data XRefEntry #

Entry in cross reference

data TableEntry #

Entry in cross reference table

Constructors

TableEntry 

Fields

data StreamEntry #

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 #

Find the last cross reference

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

Find prev cross reference

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

Read trailer for the xref

lookupTableEntry #

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 #

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 #

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