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

Pdf.Content.Processor

Description

Process content stream operators maintaining graphics state

It is pretty experimental

Synopsis

Documentation

data Processor Source #

Processor maintains graphics state

Constructors

Processor 

Fields

data GraphicsState Source #

Graphics state

Constructors

GraphicsState 

Fields

Instances

Instances details
Show GraphicsState Source # 
Instance details

Defined in Pdf.Content.Processor

type GlyphDecoder = Name -> ByteString -> [(Glyph, Double)] Source #

Given font name and string, it should return list of glyphs and their widths.

Note: it should not try to position or scale glyphs to user space, bounding boxes should be defined in glyph space.

Note: glyph width is a distance between the glyph's origin and the next glyph's origin, so it generally can't be calculated from bounding box

Note: the Processor actually doesn't cares about glyph's bounding box, so you can return anything you want

data Glyph Source #

Glyph

Constructors

Glyph 

Fields

Instances

Instances details
Show Glyph Source # 
Instance details

Defined in Pdf.Content.Processor

Methods

showsPrec :: Int -> Glyph -> ShowS #

show :: Glyph -> String #

showList :: [Glyph] -> ShowS #

data Span Source #

Glyphs drawn in one shot

Constructors

Span 

Fields

mkProcessor :: Processor Source #

Create processor in initial state

processOp :: Operator -> Processor -> Either String Processor Source #

Process one operation