summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-12-21 22:59:01 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2015-12-21 22:59:01 -0800
commit8b8bdca56a77ff9c8d6b450547064e75b5997d1e (patch)
tree80d3962631c2b81b0a7492a2b2adb53cda6900a0 /src/Text/Pandoc
parent0596b65a74a543fd065a672da6445f295d05fc36 (diff)
Allow setting margins from metadata variables for wkhtmltopdf.
Variables margin-top, margin-bottom, margin-left, margin-right. Setting them with css inside @page doesn't seem to work, at least with the released wkhtmltopdf.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/PDF.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Text/Pandoc/PDF.hs b/src/Text/Pandoc/PDF.hs
index 852e8c033..e7a19c81e 100644
--- a/src/Text/Pandoc/PDF.hs
+++ b/src/Text/Pandoc/PDF.hs
@@ -46,7 +46,6 @@ import Control.Monad (unless, when, (<=<))
import qualified Control.Exception as E
import Data.List (isInfixOf)
import Data.Maybe (fromMaybe)
-import qualified Data.Map as M
import qualified Text.Pandoc.UTF8 as UTF8
import Text.Pandoc.Definition
import Text.Pandoc.Walk (walkM)
@@ -84,7 +83,12 @@ makePDF "wkhtmltopdf" writer opts doc@(Pandoc meta _) = do
(\x -> ['-':'-':f, x]) $ getField f meta'
let args = mathArgs ++
concatMap toArgs [("page-size", Just "letter")
- ,("title", Nothing)]
+ ,("title", Nothing)
+ ,("margin-bottom", Just "1in")
+ ,("margin-top", Just "1in")
+ ,("margin-left", Just "1in")
+ ,("margin-right", Just "1in")
+ ]
let source = writer opts doc
html2pdf (writerVerbose opts) args source
makePDF program writer opts doc = withTempDir "tex2pdf." $ \tmpdir -> do