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

Pdf.Core.XRef

Description

Cross reference

Synopsis

Documentation

data XRef Source #

Cross reference

Constructors

XRefTable Int64

Offset

XRefStream Int64 Stream

Offset and stream

Instances

Instances details
Show XRef Source # 
Instance details

Defined in Pdf.Core.XRef

Methods

showsPrec :: Int -> XRef -> ShowS #

show :: XRef -> String #

showList :: [XRef] -> ShowS #

Eq XRef Source # 
Instance details

Defined in Pdf.Core.XRef

Methods

(==) :: XRef -> XRef -> Bool #

(/=) :: XRef -> XRef -> Bool #

data Entry Source #

Entry in cross reference stream

Constructors

EntryFree Int Int

Object number and generation

EntryUsed Int64 Int

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

EntryCompressed Int Int

Object number of object stream and index within the object stream

Instances

Instances details
Show Entry Source # 
Instance details

Defined in Pdf.Core.XRef

Methods

showsPrec :: Int -> Entry -> ShowS #

show :: Entry -> String #

showList :: [Entry] -> ShowS #

Eq Entry Source # 
Instance details

Defined in Pdf.Core.XRef

Methods

(==) :: Entry -> Entry -> Bool #

(/=) :: Entry -> Entry -> Bool #

readXRef :: Buffer -> Int64 -> IO XRef Source #

Read XRef at specified offset

lastXRef :: Buffer -> IO XRef Source #

Find the last cross reference

prevXRef :: Buffer -> XRef -> IO (Maybe XRef) Source #

Find prev cross reference

trailer :: Buffer -> XRef -> IO Dict Source #

Read trailer for the xref

lookupTableEntry Source #

Arguments

:: Buffer 
-> XRef

should be xref table

-> Ref

indirect object to look for

-> IO (Maybe Entry) 

Read xref entry for the indirect object from xref table

lookupStreamEntry Source #

Arguments

:: Dict

xref stream dictionary

-> InputStream ByteString

decoded xref stream content

-> Ref

indirect object

-> IO (Maybe Entry) 

Read xref entry for the indirect object from xref stream

See pdf1.7 spec: 7.5.8 Cross-Reference Streams. May throw UnknownXRefStreamEntryType

isTable :: InputStream ByteString -> IO Bool Source #

Check whether the stream starts with "xref" keyword. The keyword itself and newline after it are consumed