Which libraries do I need? Which command line parameters do I need to pass?
I've installed wkhtml2pdf and I've tried to run:
pandoc reports/7/report.html -t pdf -o reports/7/report.pdf
Which reports an error of:
To create a pdf with pandoc, use the latex or beamer writer and specify
an output file with .pdf extension (pandoc -t latex -o filename.pdf).
Pandoc can convert between numerous markup and word processing formats, including, but not limited to, various flavors of Markdown, HTML, LaTeX and Word docx. For the full lists of input and output formats, see the --from and --to options below. Pandoc can also produce PDF output: see creating a PDF, below.
There are actually two steps involved in converting a Markdown file to a PDF file: The Markdown source file is converted to a LaTeX source file. Pandoc invokes the pdflatex or xelatex or other TeX command and converts the . tex source file to a PDF file.
Pandoc includes a Haskell library and a standalone command-line program. The library includes separate modules for each input and output format, so adding a new input or output format just requires adding a new module. Pandoc is free software, released under the GPL. Copyright 2006–2022 John MacFarlane.
pdf
is not a valid output format. latex
and beamer
(for latex slideshows) are.
To create a pdf, use -t latex
and -o myoutput.pdf
. You can omit the -t
argument since a .pdf
in -o
defaults to latex. So you can use either:
pandoc reports/7/report.html -t latex -o reports/7/report.pdf
or:
pandoc reports/7/report.html -o reports/7/report.pdf
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With