yesod-content-pdf- PDF Content Type for Yesod

Safe HaskellNone




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



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.


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

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.

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.