yesod-content-pdf-0.2.0.5: PDF Content Type for Yesod

Safe HaskellNone
LanguageHaskell2010

Yesod.Content.PDF

Contents

Description

Utilities for serving PDF from Yesod. Uses and depends on command line utility wkhtmltopdf to render PDF from HTML.

Synopsis

Conversion

uri2PDF :: MonadIO m => WkhtmltopdfOptions -> URI -> m PDF Source #

Use wkhtmltopdf to render a PDF given the URI pointing to an HTML document.

html2PDF :: MonadIO m => WkhtmltopdfOptions -> Html -> m PDF Source #

Use wkhtmltopdf to render a PDF from an HTML (Text.Blaze.Html) type.

Data type

newtype PDF Source #

Constructors

PDF 

Fields

Instances
Eq PDF Source # 
Instance details

Defined in Yesod.Content.PDF

Methods

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

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

Ord PDF Source # 
Instance details

Defined in Yesod.Content.PDF

Methods

compare :: PDF -> PDF -> Ordering #

(<) :: PDF -> PDF -> Bool #

(<=) :: PDF -> PDF -> Bool #

(>) :: PDF -> PDF -> Bool #

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

max :: PDF -> PDF -> PDF #

min :: PDF -> PDF -> PDF #

Read PDF Source # 
Instance details

Defined in Yesod.Content.PDF

Show PDF Source # 
Instance details

Defined in Yesod.Content.PDF

Methods

showsPrec :: Int -> PDF -> ShowS #

show :: PDF -> String #

showList :: [PDF] -> ShowS #

ToContent PDF Source # 
Instance details

Defined in Yesod.Content.PDF

Methods

toContent :: PDF -> Content #

HasContentType PDF Source # 
Instance details

Defined in Yesod.Content.PDF

Methods

getContentType :: Monad m => m PDF -> ContentType #

ToTypedContent PDF Source # 
Instance details

Defined in Yesod.Content.PDF

typePDF :: ContentType Source #

Provide MIME type "application/pdf" as a ContentType for Yesod.

Options

def :: Default a => a #

The default value for this type.

wkCollate :: WkhtmltopdfOptions -> Bool Source #

Collate when printing multiple copies.

wkCopies :: WkhtmltopdfOptions -> Int Source #

Number of copies to print into the PDF file.

wkGrayscale :: WkhtmltopdfOptions -> Bool Source #

Whether output PDF should be in grayscale.

wkLowQuality :: WkhtmltopdfOptions -> Bool Source #

Generate lower quality output to conserve space.

wkOrientation :: WkhtmltopdfOptions -> Orientation Source #

Orientation of the output.

wkDisableSmartShrinking :: WkhtmltopdfOptions -> Bool Source #

Intelligent shrinking strategy used by WebKit that makes the pixel/dpi ratio none constant.

wkTitle :: WkhtmltopdfOptions -> Maybe String Source #

Title of the generated PDF file.

wkJavascriptDelay :: WkhtmltopdfOptions -> Maybe Int Source #

Time to wait for Javascript to finish in milliseconds.

wkWindowStatus :: WkhtmltopdfOptions -> Maybe String Source #

String to wait for window.status to be set to.

data UnitReal Source #

A unit of measure.

Instances
Eq UnitReal Source # 
Instance details

Defined in Yesod.Content.PDF

Ord UnitReal Source # 
Instance details

Defined in Yesod.Content.PDF

Show UnitReal Source # 
Instance details

Defined in Yesod.Content.PDF