git.iko.soy/typeable/pandoc
on master help sign in
Merge pull request #4237 from sitewisely/header_and_footer

Add header and footer parameters for wkhtmltopdf

commite9aadc1cfaaa6c6e20e5b7179f1291ba1c21f0ea authorJohn MacFarlane <jgm@berkeley.edu> dateSun 21 Jan 2018, 11:18 (9 years ago) parent4423f816b40b8c
2 files changed+6−2
MANUAL.txt+2−2 src/Text/Pandoc/PDF.hs+4
MANUAL.txt+2−2
@@ -200,8 +200,8 @@ PDF output can be controlled using [variables for LaTeX] (if
200200LaTeX is used) and [variables for ConTeXt] (if ConTeXt is used).
201201When using an HTML/CSS-to-PDF-engine, `--css` affects the output.
202202If `wkhtmltopdf` is used, then the variables `margin-left`,
203−`margin-right`, `margin-top`, `margin-bottom`, and `papersize`
204−will affect the output.
203+`margin-right`, `margin-top`, `margin-bottom`, `footer-html`,
204+`header-html` and `papersize` will affect the output.
205205
206206To debug the PDF creation, it can be useful to look at the intermediate
207207representation: instead of `-o test.pdf`, use for example `-s -o test.tex`
src/Text/Pandoc/PDF.hs+4
@@ -104,6 +104,10 @@ makePDF "wkhtmltopdf" pdfargs writer opts doc@(Pandoc meta _) = do
104104 (getField "margin-right" meta'))
105105 ,("margin-left", fromMaybe (Just "1.25in")
106106 (getField "margin-left" meta'))
107+ ,("footer-html", fromMaybe Nothing
108+ (getField "footer-html" meta'))
109+ ,("header-html", fromMaybe Nothing
110+ (getField "header-html" meta'))
107111 ]
108112 source <- writer opts doc
109113 verbosity <- getVerbosity