-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Generation of PDF documents
--   
--   A PDF library with support for several pages, page transitions,
--   outlines, annotations, compression, colors, shapes, patterns, jpegs,
--   fonts, typesetting ... Have a look at the
--   <a>Graphics.PDF.Documentation</a> module to see how to use it. Or,
--   download the package and look at the test.hs file in the Test folder.
--   That file is giving an example of each feature.
@package HPDF
@version 1.4.10


-- | Quick documentation for the PDF library.
--   
--   For detailed examples, download the tar.gz package from Hackage and
--   look at the test.hs in folder Test.
module Graphics.PDF.Documentation


-- | Hyphenate a string
module Graphics.PDF.Hyphenate

-- | Hyphenation databases
data HyphenationDatabase
English :: (Maybe (MapString [Int])) -> HyphenationDatabase
CustomLanguage :: (MapString [Int]) -> (MapString [Int]) -> HyphenationDatabase
data MapString v

-- | Create a custom language for hyphenation
mkCustomLanguage :: [String] -> [String] -> HyphenationDatabase
mkExceptions :: [String] -> MapString [Int]

-- | Hyphenate a string
hyphenate :: HyphenationDatabase -> String -> [String]


-- | Coordinates for a PDF document
module Graphics.PDF.Coordinates

-- | Angle
data Angle

-- | Angle in degrees
Degree :: !PDFFloat -> Angle

-- | Angle in radians
Radian :: !PDFFloat -> Angle
type Point = Complex PDFFloat

-- | A transformation matrix. An affine transformation a b c d e f
--   
--   <pre>
--   a b 0
--   c d 0
--   e f 1
--   </pre>
data Matrix
Matrix :: !PDFFloat -> !PDFFloat -> !PDFFloat -> !PDFFloat -> !PDFFloat -> !PDFFloat -> Matrix
toRadian :: Angle -> PDFFloat

-- | Dot product of two points 'dot (x :+ y) (a :+ b) == x * a + y * b'
--   'dot z w == magnitude z * magnitude w * cos (phase z - phase w)'
dot :: (RealFloat t) => Complex t -> Complex t -> t
scalePt :: (RealFloat t) => t -> Complex t -> Complex t

-- | projects the first point onto the second
project :: (RealFloat t) => Complex t -> Complex t -> Complex t

-- | projects a point onto the x-axis
projectX :: (RealFloat t) => Complex t -> Complex t

-- | projects a point onto the y-axis
projectY :: (RealFloat t) => Complex t -> Complex t

-- | Specifies a matrix as three points
pointMatrix :: Point -> Point -> Point -> Matrix

-- | Applies a matrix to a point
transform :: Matrix -> Point -> Point

-- | Identity matrix
identity :: Matrix

-- | Rotation matrix
rotate :: Angle -> Matrix

-- | Translation matrix 'transform (translate z) w == z + w'
translate :: Point -> Matrix

-- | Scaling matrix
scale :: PDFFloat -> PDFFloat -> Matrix
spiral :: Point -> Matrix
instance GHC.Show.Show Graphics.PDF.Coordinates.Matrix
instance GHC.Classes.Eq Graphics.PDF.Coordinates.Matrix
instance GHC.Num.Num Graphics.PDF.Coordinates.Matrix


-- | PDF Actions
module Graphics.PDF.Action
class PdfObject a => Action a

-- | Action of going to an URL
newtype GoToURL
GoToURL :: String -> GoToURL
instance Graphics.PDF.LowLevel.Types.PdfObject Graphics.PDF.Action.GoToURL
instance Graphics.PDF.Action.Action Graphics.PDF.Action.GoToURL
instance Graphics.PDF.LowLevel.Types.PdfLengthInfo Graphics.PDF.Action.GoToURL


-- | PDF Patterns
module Graphics.PDF.Pattern

-- | Tiling type
data TilingType
ConstantSpacing :: TilingType
NoDistortion :: TilingType
ConstantSpacingAndFaster :: TilingType
data PDFColoredPattern

-- | A PDF Pattern
data PDFUncoloredPattern

-- | Create a colored tiling pattern
createColoredTiling :: PDFFloat -> PDFFloat -> PDFFloat -> PDFFloat -> PDFFloat -> PDFFloat -> TilingType -> Draw a -> PDF (PDFReference PDFColoredPattern)

-- | Create an uncolored tiling pattern
createUncoloredTiling :: PDFFloat -> PDFFloat -> PDFFloat -> PDFFloat -> PDFFloat -> PDFFloat -> TilingType -> Draw a -> PDF (PDFReference PDFUncoloredPattern)

-- | Set the fill pattern
setColoredFillPattern :: PDFReference PDFColoredPattern -> Draw ()

-- | Set the stroke pattern
setColoredStrokePattern :: PDFReference PDFColoredPattern -> Draw ()

-- | Set the fill pattern
setUncoloredFillPattern :: PDFReference PDFUncoloredPattern -> Color -> Draw ()

-- | Set the stroke pattern
setUncoloredStrokePattern :: PDFReference PDFUncoloredPattern -> Color -> Draw ()
instance GHC.Enum.Enum Graphics.PDF.Pattern.TilingType
instance GHC.Classes.Eq Graphics.PDF.Pattern.TilingType
instance GHC.Enum.Enum Graphics.PDF.Pattern.PaintType
instance GHC.Classes.Eq Graphics.PDF.Pattern.PaintType


-- | PDF Navigation
module Graphics.PDF.Navigation
data OutlineStyle
NormalOutline :: OutlineStyle
ItalicOutline :: OutlineStyle
BoldOutline :: OutlineStyle

-- | Create a new outline section pointing to the last created page
newSection :: PDFString -> Maybe Color -> Maybe OutlineStyle -> PDF () -> PDF ()

-- | Create a new outline section pointing to a given page
newSectionWithPage :: PDFString -> Maybe Color -> Maybe OutlineStyle -> PDFReference PDFPage -> PDF () -> PDF ()


-- | PDF Images
module Graphics.PDF.Image

-- | A Jpeg PDF object
data PDFJpeg

-- | A Jpeg file
data JpegFile

-- | A raw image
data RawImage
data PDFFilter
ASCIIHexDecode :: PDFFilter
ASCII85Decode :: PDFFilter
LZWDecode :: PDFFilter
FlateDecode :: PDFFilter
RunLengthDecode :: PDFFilter
CCITTFaxDecode :: PDFFilter
DCTDecode :: PDFFilter
NoFilter :: PDFFilter

-- | Use an abstract description of a Jpeg to return a PDFReference that
--   can be used to manipulate the Jpeg in the context of the PDF document
createPDFJpeg :: JpegFile -> PDF (PDFReference PDFJpeg)

-- | Read a JPEG file and return an abstract description of its content or
--   an error The read is not lazy. The whole image will be loaded into
--   memory
readJpegFile :: FilePath -> IO (Either String JpegFile)

-- | Get the JPEG bounds
jpegBounds :: JpegFile -> (Int, Int)

-- | Reads a data URL string, and returns a JpegFile. The incoming string
--   must be a correctly formatted data URL for a JPEG. You can convert
--   jpeg files to data URLs at the following web site:
--   <a>http://dataurl.net/#dataurlmaker</a>
readJpegDataURL :: String -> Either String JpegFile
createPDFRawImageFromARGB :: Int -> Int -> Bool -> Vector Word32 -> PDF (PDFReference RawImage)
createPDFRawImageFromByteString :: Int -> Int -> Bool -> PDFFilter -> ByteString -> PDF (PDFReference RawImage)
instance GHC.Base.Functor Graphics.PDF.Image.FA
instance Control.Monad.Error.Class.MonadError GHC.Base.String Graphics.PDF.Image.FA
instance GHC.Base.Applicative Graphics.PDF.Image.FA
instance GHC.Base.Monad Graphics.PDF.Image.FA
instance Graphics.PDF.Draw.PDFXObject Graphics.PDF.Image.RawImage
instance Graphics.PDF.LowLevel.Types.PdfObject Graphics.PDF.Image.RawImage
instance Graphics.PDF.LowLevel.Types.PdfLengthInfo Graphics.PDF.Image.RawImage
instance Graphics.PDF.Resources.PdfResourceObject (Graphics.PDF.LowLevel.Types.PDFReference Graphics.PDF.Image.RawImage)
instance Graphics.PDF.Draw.PDFXObject Graphics.PDF.Image.PDFJpeg
instance Graphics.PDF.LowLevel.Types.PdfObject Graphics.PDF.Image.PDFJpeg
instance Graphics.PDF.LowLevel.Types.PdfLengthInfo Graphics.PDF.Image.PDFJpeg
instance Graphics.PDF.Resources.PdfResourceObject (Graphics.PDF.LowLevel.Types.PDFReference Graphics.PDF.Image.PDFJpeg)


-- | Management of the PDF structure
module Graphics.PDF.Document
data PDFXForm

-- | Add a new page to a PDF document
addPage :: Maybe PDFRect -> PDF (PDFReference PDFPage)
addPageWithTransition :: Maybe PDFRect -> Maybe PDFFloat -> Maybe PDFTransition -> PDF (PDFReference PDFPage)

-- | Draw on a given page
drawWithPage :: PDFReference PDFPage -> Draw a -> PDF a

-- | Create a PDF XObject
createPDFXForm :: PDFFloat -> PDFFloat -> PDFFloat -> PDFFloat -> Draw a -> PDF (PDFReference PDFXForm)

-- | A PDF Transition
data PDFTransition
PDFTransition :: !PDFFloat -> !PDFTransStyle -> PDFTransition

-- | Transition style
data PDFTransStyle
Split :: PDFTransDimension -> PDFTransDirection -> PDFTransStyle
Blinds :: PDFTransDimension -> PDFTransStyle
Box :: PDFTransDirection -> PDFTransStyle
Wipe :: PDFTransDirection2 -> PDFTransStyle
Dissolve :: PDFTransStyle
Glitter :: PDFTransDirection2 -> PDFTransStyle

-- | Direction of a transition
data PDFTransDirection
Inward :: PDFTransDirection
Outward :: PDFTransDirection

-- | Dimension of a transition
data PDFTransDimension
Horizontal :: PDFTransDimension
Vertical :: PDFTransDimension

-- | Direction of a transition
data PDFTransDirection2
LeftToRight :: PDFTransDirection2

-- | Wipe only
BottomToTop :: PDFTransDirection2

-- | Wipe only
RightToLeft :: PDFTransDirection2
TopToBottom :: PDFTransDirection2

-- | Glitter only
TopLeftToBottomRight :: PDFTransDirection2

-- | Document metadata
data PDFDocumentInfo
PDFDocumentInfo :: PDFString -> PDFString -> PDFDocumentPageMode -> PDFDocumentPageLayout -> PDFViewerPreferences -> Bool -> PDFDocumentInfo
[author] :: PDFDocumentInfo -> PDFString
[subject] :: PDFDocumentInfo -> PDFString
[pageMode] :: PDFDocumentInfo -> PDFDocumentPageMode
[pageLayout] :: PDFDocumentInfo -> PDFDocumentPageLayout
[viewerPreferences] :: PDFDocumentInfo -> PDFViewerPreferences
[compressed] :: PDFDocumentInfo -> Bool

-- | Document page mode
data PDFDocumentPageMode
UseNone :: PDFDocumentPageMode
UseOutlines :: PDFDocumentPageMode
UseThumbs :: PDFDocumentPageMode
FullScreen :: PDFDocumentPageMode

-- | Document page layout
data PDFDocumentPageLayout
SinglePage :: PDFDocumentPageLayout
OneColumn :: PDFDocumentPageLayout
TwoColumnLeft :: PDFDocumentPageLayout
TwoColumnRight :: PDFDocumentPageLayout
TwoPageLeft :: PDFDocumentPageLayout
TwoPageRight :: PDFDocumentPageLayout

-- | Viewer preferences
data PDFViewerPreferences
PDFViewerPreferences :: Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> PDFDocumentPageMode -> PDFViewerPreferences

-- | To hide the toolbar
[hideToolbar] :: PDFViewerPreferences -> Bool

-- | To hide the menubar
[hideMenuBar] :: PDFViewerPreferences -> Bool

-- | To hide the window
[hideWindowUI] :: PDFViewerPreferences -> Bool

-- | Fit window to screen
[fitWindow] :: PDFViewerPreferences -> Bool

-- | Center window on screen
[centerWindow] :: PDFViewerPreferences -> Bool

-- | Display the docu,ent title
[displayDoctitle] :: PDFViewerPreferences -> Bool

-- | Display mode when exiting the full screen mode
[nonFullScreenPageMode] :: PDFViewerPreferences -> PDFDocumentPageMode

-- | No information for the document
standardDocInfo :: PDFDocumentInfo
standardViewerPrefs :: PDFViewerPreferences

-- | The drawing monad
data Draw a

-- | A PDF Xobject which can be drawn
class PDFXObject a
drawXObject :: PDFXObject a => PDFReference a -> Draw ()
class PDFGlobals m
bounds :: (PDFGlobals m, PDFXObject a) => PDFReference a -> m (PDFFloat, PDFFloat)

-- | Draw in a new drawing context without perturbing the previous context
--   that is restored after the draw
withNewContext :: Draw a -> Draw a

-- | An empty drawing
emptyDrawing :: Draw ()


-- | PDF Annotations
module Graphics.PDF.Annotation
data TextAnnotation
TextAnnotation :: PDFString -> [PDFFloat] -> TextIcon -> TextAnnotation
data URLLink
URLLink :: PDFString -> [PDFFloat] -> String -> Bool -> URLLink
data PDFLink
PDFLink :: PDFString -> [PDFFloat] -> (PDFReference PDFPage) -> PDFFloat -> PDFFloat -> Bool -> PDFLink
data TextIcon
Note :: TextIcon
Paragraph :: TextIcon
NewParagraph :: TextIcon
Key :: TextIcon
Comment :: TextIcon
Help :: TextIcon
Insert :: TextIcon

-- | Create a new annotation object
newAnnotation :: (PdfObject a, AnnotationObject a) => a -> Draw ()
instance GHC.Show.Show Graphics.PDF.Annotation.TextIcon
instance GHC.Classes.Eq Graphics.PDF.Annotation.TextIcon
instance Graphics.PDF.LowLevel.Types.PdfObject Graphics.PDF.Annotation.PDFLink
instance Graphics.PDF.LowLevel.Types.PdfLengthInfo Graphics.PDF.Annotation.PDFLink
instance Graphics.PDF.Draw.AnnotationObject Graphics.PDF.Annotation.PDFLink
instance Graphics.PDF.LowLevel.Types.PdfObject Graphics.PDF.Annotation.URLLink
instance Graphics.PDF.LowLevel.Types.PdfLengthInfo Graphics.PDF.Annotation.URLLink
instance Graphics.PDF.Draw.AnnotationObject Graphics.PDF.Annotation.URLLink
instance Graphics.PDF.LowLevel.Types.PdfObject Graphics.PDF.Annotation.TextAnnotation
instance Graphics.PDF.LowLevel.Types.PdfLengthInfo Graphics.PDF.Annotation.TextAnnotation
instance Graphics.PDF.Draw.AnnotationObject Graphics.PDF.Annotation.TextAnnotation


-- | Colors for a PDF document
module Graphics.PDF.Colors

-- | A PDF color
data Color
Rgb :: !Double -> !Double -> !Double -> Color
Hsv :: !Double -> !Double -> !Double -> Color

-- | Init the PDF color space to RGB.
setRGBColorSpace :: Draw ()

-- | Select the filling color
fillColor :: MonadPath m => Color -> m ()

-- | Select the drawing color
strokeColor :: MonadPath m => Color -> m ()

-- | Set alpha value for transparency
setStrokeAlpha :: Double -> Draw ()

-- | Set alpha value for transparency
setFillAlpha :: Double -> Draw ()
hsvToRgb :: (Double, Double, Double) -> (Double, Double, Double)
black :: Color
white :: Color
red :: Color
blue :: Color
green :: Color


-- | PDF Shapes
module Graphics.PDF.Shapes

-- | Move pen to a given point without drawing anything
moveto :: Point -> Draw ()

-- | Draw a line from current point to the one specified by lineto
lineto :: Point -> Draw ()

-- | Approximate a circular arc by one cubic bezier curve. larger arc
--   angles mean larger distortions
arcto :: Angle -> Point -> Draw ()
curveto :: Point -> Point -> Point -> Draw ()

-- | Begin a new path at a position
beginPath :: Point -> Draw ()

-- | Close current path
closePath :: Draw ()

-- | Append a cubic Bezier curve to the current path. The curve extends
--   from the current point to the point (x3 , y3), using (x1 , y1 ) and
--   (x2, y2) as the Bezier control points
addBezierCubic :: Point -> Point -> Point -> Draw ()

-- | Add a polygon to current path
addPolygonToPath :: [Point] -> Draw ()
addLineToPath :: Point -> Draw ()

-- | Draw current path
strokePath :: Draw ()

-- | Fill current path
fillPath :: Draw ()

-- | Fill current path
fillAndStrokePath :: Draw ()

-- | Fill current path using even odd rule
fillPathEO :: Draw ()

-- | Fill current path using even odd rule
fillAndStrokePathEO :: Draw ()

-- | Set clipping path
setAsClipPath :: Draw ()

-- | Set clipping path
setAsClipPathEO :: Draw ()
class Shape a
addShape :: Shape a => a -> Draw ()
stroke :: Shape a => a -> Draw ()
fill :: Shape a => a -> Draw ()
fillAndStroke :: Shape a => a -> Draw ()
fillEO :: Shape a => a -> Draw ()
fillAndStrokeEO :: Shape a => a -> Draw ()
data Line
Line :: PDFFloat -> PDFFloat -> PDFFloat -> PDFFloat -> Line
data Rectangle
Rectangle :: !Point -> !Point -> Rectangle
newtype Polygon
Polygon :: [Point] -> Polygon
data Arc
Arc :: PDFFloat -> PDFFloat -> PDFFloat -> PDFFloat -> Arc
data Ellipse
Ellipse :: PDFFloat -> PDFFloat -> PDFFloat -> PDFFloat -> Ellipse
data Circle
Circle :: PDFFloat -> PDFFloat -> PDFFloat -> Circle
data RoundRectangle
RoundRectangle :: PDFFloat -> PDFFloat -> PDFFloat -> PDFFloat -> PDFFloat -> PDFFloat -> RoundRectangle

-- | Line cap styles
data CapStyle
ButtCap :: CapStyle
RoundCap :: CapStyle
SquareCap :: CapStyle

-- | Line join styles
data JoinStyle
MiterJoin :: JoinStyle
RoundJoin :: JoinStyle
BevelJoin :: JoinStyle
data DashPattern
DashPattern :: ![PDFFloat] -> PDFFloat -> DashPattern

-- | Set pen width
setWidth :: MonadPath m => PDFFloat -> m ()

-- | Set line cap
setLineCap :: MonadPath m => CapStyle -> m ()

-- | Set line join
setLineJoin :: MonadPath m => JoinStyle -> m ()

-- | Set the dash pattern
setDash :: MonadPath m => DashPattern -> m ()

-- | No dash pattern
setNoDash :: MonadPath m => m ()

-- | Set pen width
setMiterLimit :: MonadPath m => PDFFloat -> m ()
instance GHC.Classes.Eq Graphics.PDF.Shapes.DashPattern
instance GHC.Enum.Enum Graphics.PDF.Shapes.JoinStyle
instance GHC.Classes.Eq Graphics.PDF.Shapes.JoinStyle
instance GHC.Enum.Enum Graphics.PDF.Shapes.CapStyle
instance GHC.Classes.Eq Graphics.PDF.Shapes.CapStyle
instance GHC.Classes.Eq Graphics.PDF.Shapes.Circle
instance GHC.Classes.Eq Graphics.PDF.Shapes.RoundRectangle
instance GHC.Classes.Eq Graphics.PDF.Shapes.Ellipse
instance GHC.Classes.Eq Graphics.PDF.Shapes.Arc
instance GHC.Classes.Eq Graphics.PDF.Shapes.Rectangle
instance GHC.Classes.Eq Graphics.PDF.Shapes.Line
instance Graphics.PDF.Shapes.Shape Graphics.PDF.Shapes.Polygon
instance Graphics.PDF.Shapes.Shape Graphics.PDF.Shapes.Circle
instance Graphics.PDF.Shapes.Shape Graphics.PDF.Shapes.RoundRectangle
instance Graphics.PDF.Shapes.Shape Graphics.PDF.Shapes.Ellipse
instance Graphics.PDF.Shapes.Shape Graphics.PDF.Shapes.Arc
instance Graphics.PDF.Shapes.Shape Graphics.PDF.Shapes.Rectangle
instance Graphics.PDF.Shapes.Shape Graphics.PDF.Shapes.Line


-- | PDF shading
module Graphics.PDF.Shading

-- | A shading
data PDFShading
AxialShading :: PDFFloat -> PDFFloat -> PDFFloat -> PDFFloat -> Color -> Color -> PDFShading
RadialShading :: PDFFloat -> PDFFloat -> PDFFloat -> PDFFloat -> PDFFloat -> PDFFloat -> Color -> Color -> PDFShading
paintWithShading :: PDFShading -> Draw a -> Draw ()

-- | Fill clipping region with a shading
applyShading :: PDFShading -> Draw ()


-- | PDF Text
module Graphics.PDF.Text
data PDFFont
PDFFont :: FontName -> FontSize -> PDFFont
data FontName
Helvetica :: FontName
Helvetica_Bold :: FontName
Helvetica_Oblique :: FontName
Helvetica_BoldOblique :: FontName
Times_Roman :: FontName
Times_Bold :: FontName
Times_Italic :: FontName
Times_BoldItalic :: FontName
Courier :: FontName
Courier_Bold :: FontName
Courier_Oblique :: FontName
Courier_BoldOblique :: FontName
Symbol :: FontName
ZapfDingbats :: FontName

-- | Rendering mode for text display
data TextMode
FillText :: TextMode
StrokeText :: TextMode
FillAndStrokeText :: TextMode
InvisibleText :: TextMode
FillTextAndAddToClip :: TextMode
StrokeTextAndAddToClip :: TextMode
FillAndStrokeTextAndAddToClip :: TextMode
AddToClip :: TextMode

-- | The text monad
data PDFText a

-- | Unscaled unit (not scaled by the font size)
type UnscaledUnit = PDFFloat

-- | Draw a text in the draw monad
drawText :: PDFText a -> Draw a

-- | Utility function to quickly display one line of text
text :: PDFFont -> PDFFloat -> PDFFloat -> PDFString -> PDFText ()

-- | Create a PDF string from an Haskell one
toPDFString :: String -> PDFString

-- | Start a new line (leading value must have been set)
startNewLine :: PDFText ()

-- | Display some text
displayText :: PDFString -> PDFText ()

-- | Set position for the text beginning
textStart :: PDFFloat -> PDFFloat -> PDFText ()

-- | Select a font to use
setFont :: PDFFont -> PDFText ()

-- | Set leading value
leading :: UnscaledUnit -> PDFText ()

-- | Set the additional char space
charSpace :: UnscaledUnit -> PDFText ()

-- | Set the additional word space
wordSpace :: UnscaledUnit -> PDFText ()

-- | Set scaling factor for text
textScale :: PDFFloat -> PDFText ()

-- | Choose the text rendering mode
renderMode :: TextMode -> PDFText ()

-- | Set the rise value
rise :: UnscaledUnit -> PDFText ()

-- | Set the text transformation matrix
setTextMatrix :: Matrix -> PDFText ()
textWidth :: PDFFont -> PDFString -> PDFFloat
getDescent :: PDFFont -> PDFFloat
getHeight :: PDFFont -> PDFFloat
ripText :: PDFFont -> PDFString -> [(PDFFloat, Char)]
charWidth :: PDFFont -> Char -> PDFFloat
instance GHC.Enum.Enum Graphics.PDF.Text.TextMode
instance GHC.Classes.Ord Graphics.PDF.Text.TextMode
instance GHC.Classes.Eq Graphics.PDF.Text.TextMode
instance Control.Monad.State.Class.MonadState Graphics.PDF.Text.TextParameter Graphics.PDF.Text.PDFText
instance Control.Monad.Writer.Class.MonadWriter Data.ByteString.Builder.Internal.Builder Graphics.PDF.Text.PDFText
instance GHC.Base.Functor Graphics.PDF.Text.PDFText
instance GHC.Base.Applicative Graphics.PDF.Text.PDFText
instance GHC.Base.Monad Graphics.PDF.Text.PDFText
instance Graphics.PDF.LowLevel.Types.MonadPath Graphics.PDF.Text.PDFText


-- | Experimental typesetting. It is a work in progress
module Graphics.PDF.Typesetting

-- | A box is an object with dimensions and used in the typesetting process
class Box a

-- | Box width
boxWidth :: Box a => a -> PDFFloat

-- | Box height
boxHeight :: Box a => a -> PDFFloat

-- | Distance between box bottom and box baseline
boxDescent :: Box a => a -> PDFFloat

-- | Distance between box top and box baseline
boxAscent :: Box a => a -> PDFFloat

-- | A box that can be displayed
class DisplayableBox a

-- | Draw a box
strokeBox :: DisplayableBox a => a -> PDFFloat -> PDFFloat -> Draw ()

-- | A letter which can be anything. Sizes are widths and for glue the
--   dilation and compression factors For the generic letter, height and
--   descent are also provided
data Letter s

-- | Any box as a letter
Letter :: BoxDimension -> !AnyBox -> !(Maybe s) -> Letter s

-- | A glue with style to know if it is part of the same sentence
Glue :: !PDFFloat -> !PDFFloat -> !PDFFloat -> !(Maybe s) -> Letter s

-- | Hyphen point
FlaggedPenalty :: !PDFFloat -> !Int -> !s -> Letter s

-- | Penalty
Penalty :: !Int -> Letter s

-- | A char
AChar :: !s -> !Char -> !PDFFloat -> Letter s

-- | A kern : non dilatable and non breakable glue
Kern :: !PDFFloat -> !(Maybe s) -> Letter s

-- | Dimension of a box : width, height and descent
type BoxDimension = (PDFFloat, PDFFloat, PDFFloat)

-- | Style of text (sentences and words). Minimum definition textStyle
class ComparableStyle a => Style a

-- | Modify the look of a sentence (sequence of words using the same style
--   on a line)
sentenceStyle :: Style a => a -> Maybe (Rectangle -> Draw b -> Draw ())
wordStyle :: Style a => a -> Maybe (Rectangle -> StyleFunction -> Draw b -> Draw ())
textStyle :: Style a => a -> TextStyle

-- | A style may contain data changed from word to word
updateStyle :: Style a => a -> a

-- | A style may change the height of words
--   
--   <pre>
--   Default implementation
--   styleHeight = getHeight . textFont . textStyle
--   </pre>
styleHeight :: Style a => a -> PDFFloat

-- | A style may change the descent of lines
--   
--   <pre>
--   Default implementation
--   styleDescent = getDescent . textFont . textStyle
--   </pre>
styleDescent :: Style a => a -> PDFFloat

-- | Text style used by PDF operators
data TextStyle
TextStyle :: !PDFFont -> !Color -> !Color -> !TextMode -> !PDFFloat -> !PDFFloat -> !PDFFloat -> !PDFFloat -> TextStyle
[textFont] :: TextStyle -> !PDFFont
[textStrokeColor] :: TextStyle -> !Color
[textFillColor] :: TextStyle -> !Color
[textMode] :: TextStyle -> !TextMode
[penWidth] :: TextStyle -> !PDFFloat

-- | Scaling factor for normal space size (scale also the dilation and
--   compression factors)
[scaleSpace] :: TextStyle -> !PDFFloat

-- | Scale the dilation factor of glues
[scaleDilatation] :: TextStyle -> !PDFFloat

-- | Scale the compression factor of glues
[scaleCompression] :: TextStyle -> !PDFFloat

-- | What kind of style drawing function is required for a word when word
--   styling is enabled
data StyleFunction

-- | Must style a word
DrawWord :: StyleFunction

-- | Must style a glue
DrawGlue :: StyleFunction

-- | Paragraph style
class (ComparableStyle a, Style s) => ParagraphStyle a s | a -> s

-- | Width of the line of the paragraph
lineWidth :: ParagraphStyle a s => a -> PDFFloat -> Int -> PDFFloat

-- | Horizontal shift of the line position relatively to the left egde of
--   the paragraph bounding box
linePosition :: ParagraphStyle a s => a -> PDFFloat -> Int -> PDFFloat

-- | How to style the interline glues added in a paragraph by the line
--   breaking algorithm
interline :: ParagraphStyle a s => a -> Maybe (Rectangle -> Draw ())

-- | Change the content of a paragraph before the line breaking algorithm
--   is run. It may also change the style
paragraphChange :: ParagraphStyle a s => a -> Int -> [Letter s] -> (a, [Letter s])

-- | Get the paragraph bounding box and the paragraph draw command to apply
--   additional effects
paragraphStyle :: ParagraphStyle a s => a -> Maybe (Rectangle -> Draw b -> Draw ())

-- | A MonadStyle where some typesetting operators can be used
class (Style s, Monad m) => MonadStyle s m | m -> s

-- | Set the current text style
setStyle :: MonadStyle s m => s -> m ()

-- | Get the current text style
currentStyle :: MonadStyle s m => m s

-- | Add a box using the current mode (horizontal or vertical. The current
--   style is always applied to the added box)
addBox :: (MonadStyle s m, Show a, DisplayableBox a, Box a) => a -> PDFFloat -> PDFFloat -> PDFFloat -> m ()

-- | Add a glue using the current style
glue :: MonadStyle s m => PDFFloat -> PDFFloat -> PDFFloat -> m ()

-- | Add a glue with no style (it is just a translation)
unstyledGlue :: MonadStyle s m => PDFFloat -> PDFFloat -> PDFFloat -> m ()

-- | Used to compare two style without taking into account the style state
class ComparableStyle a
isSameStyleAs :: ComparableStyle a => a -> a -> Bool
data Para s a
data TM ps s a
data VBox ps s
data VerState s
VerState :: !(PDFFloat, PDFFloat, PDFFloat) -> !(PDFFloat, PDFFloat, PDFFloat) -> !PDFFloat -> !s -> VerState s

-- | Default value (12,0.17,0.0)
[baselineskip] :: VerState s -> !(PDFFloat, PDFFloat, PDFFloat)

-- | Default value (3.0,0.33,0.0)
[lineskip] :: VerState s -> !(PDFFloat, PDFFloat, PDFFloat)

-- | Default value 2
[lineskiplimit] :: VerState s -> !PDFFloat
[currentParagraphStyle] :: VerState s -> !s

-- | Container for vboxes (x,y,width,maxheight,height,currenty,current z,
--   tolerance para) tolerance para means a paragraph is not started if too
--   close from the bottom edge of the box
data Container ps s
data Justification
FullJustification :: Justification
Centered :: Justification
LeftJustification :: Justification
RightJustification :: Justification
data Orientation
E :: Orientation
W :: Orientation
N :: Orientation
S :: Orientation
NE :: Orientation
NW :: Orientation
SE :: Orientation
SW :: Orientation

-- | Display a formatted text in a given bounding rectangle with a given
--   default paragraph style, a given default text style. No clipping is
--   taking place. Drawing stop when the last line is crossing the bounding
--   rectangle in vertical direction
displayFormattedText :: (ParagraphStyle ps s) => Rectangle -> ps -> s -> TM ps s a -> Draw a

-- | Add a text line
txt :: Style s => String -> Para s ()

-- | add a kern (space that can be dilated or compressed and on which no
--   line breaking can occur)
kern :: Style s => PDFFloat -> Para s ()

-- | Add a penalty
addPenalty :: Int -> Para s ()

-- | Make a letter from any box
mkLetter :: (Show a, Box a, DisplayableBox a) => BoxDimension -> Maybe s -> a -> Letter s

-- | Make a drawing box. A box object containing a Draw value
mkDrawBox :: Draw () -> DrawBox

-- | For a newline and end the current paragraph
forceNewLine :: Style s => Para s ()

-- | Add a new paragraph to the text
paragraph :: Style s => Para s a -> TM ps s a
endPara :: Style s => Para s ()
startPara :: Style s => Para s ()

-- | Get the current paragraph style
getParaStyle :: TM ps s ps

-- | Change the current paragraph style
setParaStyle :: ParagraphStyle ps s => ps -> TM ps s ()

-- | Create a empty container to constraint the amount of line that can be
--   displayed
mkContainer :: PDFFloat -> PDFFloat -> PDFFloat -> PDFFloat -> PDFFloat -> Container ps s

-- | Fill a container with lines
fillContainer :: (ParagraphStyle ps s, ComparableStyle ps) => VerState ps -> Container ps s -> [VBox ps s] -> (Draw (), Container ps s, [VBox ps s])

-- | Default vertical state
--   
--   <pre>
--   Default values
--   baselineskip = (12,0.17,0.0)
--   lineskip = (3.0,0.33,0.0)
--   lineskiplimit = 2
--   </pre>
defaultVerState :: s -> VerState s

-- | Return the list of Vboxes for a text
getBoxes :: (ParagraphStyle ps s) => ps -> s -> TM ps s a -> [VBox ps s]

-- | Container horizontal position
containerX :: Container ps s -> PDFFloat

-- | Container vertical position
containerY :: Container ps s -> PDFFloat

-- | Get the width of the container
containerWidth :: Container ps s -> PDFFloat

-- | Get the height of the container
containerHeight :: Container ps s -> PDFFloat

-- | Get the content height of the container with glue dilatation
containerContentHeight :: Container ps s -> PDFFloat

-- | Get the maximum right border of the container content (maybe bigger
--   than container width due to overfull lines)
containerContentRightBorder :: Container ps s -> PDFFloat

-- | Get the minimum left border of the container content
containerContentLeftBorder :: Container ps s -> PDFFloat

-- | Get the current height of the container without glue dilatation
containerCurrentHeight :: Container ps s -> PDFFloat

-- | Return the rectangle containing the text after formatting and glue
--   dilatation
containerContentRectangle :: Container ps s -> Rectangle

-- | Draw a text box with relative position. Useful for labels
drawTextBox :: (ParagraphStyle ps s, Style s) => PDFFloat -> PDFFloat -> PDFFloat -> PDFFloat -> Orientation -> ps -> s -> TM ps s a -> (Rectangle, Draw ())
setFirstPassTolerance :: PDFFloat -> TM ps s ()
setSecondPassTolerance :: PDFFloat -> TM ps s ()
setHyphenPenaltyValue :: Int -> TM ps s ()
setFitnessDemerit :: PDFFloat -> TM ps s ()
setHyphenDemerit :: PDFFloat -> TM ps s ()
setLinePenalty :: PDFFloat -> TM ps s ()
getFirstPassTolerance :: TM ps s PDFFloat
getSecondPassTolerance :: TM ps s PDFFloat
getHyphenPenaltyValue :: TM ps s Int
getFitnessDemerit :: TM ps s PDFFloat
getHyphenDemerit :: TM ps s PDFFloat
getLinePenalty :: TM ps s PDFFloat
setJustification :: Justification -> TM ps s ()
setBaseLineSkip :: PDFFloat -> PDFFloat -> PDFFloat -> TM ps s ()
setLineSkipLimit :: PDFFloat -> TM ps s ()
setLineSkip :: PDFFloat -> PDFFloat -> PDFFloat -> TM ps s ()
getBaseLineSkip :: TM ps s (PDFFloat, PDFFloat, PDFFloat)
getLineSkipLimit :: TM ps s PDFFloat
getLineSkip :: TM ps s (PDFFloat, PDFFloat, PDFFloat)

-- | Standard styles for sentences
data StandardStyle
Font :: PDFFont -> Color -> Color -> StandardStyle

-- | Standard styles for paragraphs
data StandardParagraphStyle
NormalParagraph :: StandardParagraphStyle
instance GHC.Show.Show Graphics.PDF.Typesetting.Orientation
instance GHC.Classes.Eq Graphics.PDF.Typesetting.Orientation
instance GHC.Base.Functor (Graphics.PDF.Typesetting.Para s)
instance Control.Monad.State.Class.MonadState s (Graphics.PDF.Typesetting.Para s)
instance Control.Monad.Reader.Class.MonadReader Graphics.PDF.Typesetting.Breaking.BRState (Graphics.PDF.Typesetting.Para s)
instance Control.Monad.Writer.Class.MonadWriter [Graphics.PDF.Typesetting.Breaking.Letter s] (Graphics.PDF.Typesetting.Para s)
instance GHC.Base.Applicative (Graphics.PDF.Typesetting.Para s)
instance GHC.Base.Monad (Graphics.PDF.Typesetting.Para s)
instance GHC.Base.Functor (Graphics.PDF.Typesetting.TM ps s)
instance Control.Monad.State.Class.MonadState (Graphics.PDF.Typesetting.TMState ps s) (Graphics.PDF.Typesetting.TM ps s)
instance Control.Monad.Writer.Class.MonadWriter [Graphics.PDF.Typesetting.Layout.VBox ps s] (Graphics.PDF.Typesetting.TM ps s)
instance GHC.Base.Applicative (Graphics.PDF.Typesetting.TM ps s)
instance GHC.Base.Monad (Graphics.PDF.Typesetting.TM ps s)
instance Graphics.PDF.Typesetting.Box.Style s => Graphics.PDF.Typesetting.MonadStyle s (Graphics.PDF.Typesetting.TM ps s)
instance Graphics.PDF.Typesetting.Box.Style s => Graphics.PDF.Typesetting.MonadStyle s (Graphics.PDF.Typesetting.Para s)


-- | Generation of PDF documents A PDF library with support for several
--   pages, page transitions, outlines, annotations, compression, colors,
--   shapes, patterns, jpegs, fonts, typesetting ... Have a look at the
--   <a>Graphics.PDF.Documentation</a> module to see how to use it. Or,
--   download the package and look at the test.hs file in the Test folder.
--   That file is giving an example of each feature.
module Graphics.PDF

-- | The PDF Monad
data PDF a

-- | Generates a PDF document
runPdf :: String -> PDFDocumentInfo -> PDFRect -> PDF a -> IO ()

-- | Generate a lazy bytestring for the PDF
pdfByteString :: PDFDocumentInfo -> PDFRect -> PDF a -> ByteString

-- | A PDF rectangle
data PDFRect
PDFRect :: !Int -> !Int -> !Int -> !Int -> PDFRect

-- | A real number in a PDF document
type PDFFloat = Double

-- | A reference to a PDF object
data PDFReference s

-- | A PDFString containing a strict bytestring
data PDFString

-- | A PDF Page object
data PDFPage

-- | List of all pages
data Pages

-- | Apply a transformation matrix to the current coordinate frame
applyMatrix :: Matrix -> Draw ()
instance Graphics.PDF.LowLevel.Types.PdfObject Graphics.PDF.PDFTrailer
instance Graphics.PDF.LowLevel.Types.PdfLengthInfo Graphics.PDF.PDFTrailer
