From 43711ade22dfd90600a0b2bdfd04fd0936e4052b Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 2 Mar 2020 15:26:11 -0800 Subject: PDF via wkhtmltopdf: put user-specified options last. Certain options (e.g. "cover") need to come after flags on the command line. Closes #6171. --- src/Text/Pandoc/PDF.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/PDF.hs b/src/Text/Pandoc/PDF.hs index e0d1263f0..fac992c4e 100644 --- a/src/Text/Pandoc/PDF.hs +++ b/src/Text/Pandoc/PDF.hs @@ -142,7 +142,7 @@ makeWithWkhtmltopdf program pdfargs writer opts doc@(Pandoc meta _) = do (return . literal . stringify) meta let toArgs (f, mbd) = maybe [] (\d -> ["--" <> f, T.unpack d]) mbd - let args = pdfargs ++ mathArgs ++ concatMap toArgs + let args = mathArgs ++ concatMap toArgs [("page-size", getField "papersize" meta') ,("title", getField "title" meta') ,("margin-bottom", Just $ fromMaybe "1.2in" @@ -155,7 +155,7 @@ makeWithWkhtmltopdf program pdfargs writer opts doc@(Pandoc meta _) = do (getField "margin-left" meta')) ,("footer-html", getField "footer-html" meta') ,("header-html", getField "header-html" meta') - ] + ] ++ pdfargs source <- writer opts doc verbosity <- getVerbosity liftIO $ html2pdf verbosity program args source -- cgit v1.2.3