pdf-toolbox-content-0.0.5.1: A collection of tools for processing PDF files

Safe HaskellNone
LanguageHaskell98

Pdf.Toolbox.Content.Processor

Description

Process content stream operators maintaining graphics state

It is pretty experimental

Synopsis

Documentation

data Processor #

Processor maintains graphics state

Constructors

Processor 

Fields

data GraphicsState #

Graphics state

Constructors

GraphicsState 

Fields

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

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 #

Glyph

Constructors

Glyph 

Fields

Instances

initialGraphicsState :: GraphicsState #

Empty graphics state

mkProcessor :: Processor #

Create processor in initial state

processOp :: Monad m => Operator -> Processor -> PdfE m Processor #

Process one operation