yesod-content-pdf-0.2.0.1: 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

typePDF :: ContentType Source

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

Options

def :: Default a => a

The default value for this type.

data WkhtmltopdfOptions Source

Options passed to wkhtmltopdf. Please use the def value and then modify individual settings. For more information, see http://www.yesodweb.com/book/settings-types.

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.

wkTitle :: WkhtmltopdfOptions -> Maybe String Source

Title of the generated PDF file.