Safe Haskell | None |
---|---|
Language | Haskell2010 |
Utilities for serving PDF from Yesod. Uses and depends on command line utility wkhtmltopdf to render PDF from HTML.
Synopsis
- uri2PDF :: MonadIO m => WkhtmltopdfOptions -> URI -> m PDF
- html2PDF :: MonadIO m => WkhtmltopdfOptions -> Html -> m PDF
- newtype PDF = PDF {}
- typePDF :: ContentType
- def :: Default a => a
- data WkhtmltopdfOptions
- wkCollate :: WkhtmltopdfOptions -> Bool
- wkCopies :: WkhtmltopdfOptions -> Int
- wkGrayscale :: WkhtmltopdfOptions -> Bool
- wkLowQuality :: WkhtmltopdfOptions -> Bool
- wkPageSize :: WkhtmltopdfOptions -> PageSize
- wkOrientation :: WkhtmltopdfOptions -> Orientation
- wkDisableSmartShrinking :: WkhtmltopdfOptions -> Bool
- wkTitle :: WkhtmltopdfOptions -> Maybe String
- wkMarginBottom :: WkhtmltopdfOptions -> UnitReal
- wkMarginLeft :: WkhtmltopdfOptions -> UnitReal
- wkMarginRight :: WkhtmltopdfOptions -> UnitReal
- wkMarginTop :: WkhtmltopdfOptions -> UnitReal
- wkZoom :: WkhtmltopdfOptions -> Double
- wkJavascriptDelay :: WkhtmltopdfOptions -> Maybe Int
- wkWindowStatus :: WkhtmltopdfOptions -> Maybe String
- data PageSize
- data Orientation
- data UnitReal
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
Instances
Eq PDF Source # | |
Ord PDF Source # | |
Read PDF Source # | |
Show PDF Source # | |
ToContent PDF Source # | |
Defined in Yesod.Content.PDF | |
HasContentType PDF Source # | |
Defined in Yesod.Content.PDF getContentType :: Monad m => m PDF -> ContentType # | |
ToTypedContent PDF Source # | |
Defined in Yesod.Content.PDF toTypedContent :: PDF -> TypedContent # |
typePDF :: ContentType Source #
Provide MIME type "application/pdf" as a ContentType for Yesod.
Options
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.
Instances
Eq WkhtmltopdfOptions Source # | |
Defined in Yesod.Content.PDF (==) :: WkhtmltopdfOptions -> WkhtmltopdfOptions -> Bool # (/=) :: WkhtmltopdfOptions -> WkhtmltopdfOptions -> Bool # | |
Ord WkhtmltopdfOptions Source # | |
Defined in Yesod.Content.PDF compare :: WkhtmltopdfOptions -> WkhtmltopdfOptions -> Ordering # (<) :: WkhtmltopdfOptions -> WkhtmltopdfOptions -> Bool # (<=) :: WkhtmltopdfOptions -> WkhtmltopdfOptions -> Bool # (>) :: WkhtmltopdfOptions -> WkhtmltopdfOptions -> Bool # (>=) :: WkhtmltopdfOptions -> WkhtmltopdfOptions -> Bool # max :: WkhtmltopdfOptions -> WkhtmltopdfOptions -> WkhtmltopdfOptions # min :: WkhtmltopdfOptions -> WkhtmltopdfOptions -> WkhtmltopdfOptions # | |
Show WkhtmltopdfOptions Source # | |
Defined in Yesod.Content.PDF showsPrec :: Int -> WkhtmltopdfOptions -> ShowS # show :: WkhtmltopdfOptions -> String # showList :: [WkhtmltopdfOptions] -> ShowS # | |
Default WkhtmltopdfOptions Source # | |
Defined in Yesod.Content.PDF |
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.
wkMarginBottom :: WkhtmltopdfOptions -> UnitReal Source #
Bottom margin size.
wkMarginLeft :: WkhtmltopdfOptions -> UnitReal Source #
Left margin size.
wkMarginRight :: WkhtmltopdfOptions -> UnitReal Source #
Right margin size.
wkMarginTop :: WkhtmltopdfOptions -> UnitReal Source #
Top margin size.
wkZoom :: WkhtmltopdfOptions -> Double Source #
Zoom factor.
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.
Cf. wkPageSize
.
A4 | |
Letter | |
OtherPageSize String | |
CustomPageSize UnitReal UnitReal | Height and width. |
data Orientation Source #
Cf. wkOrientation
.