2025-03-14 21:59:59 -06:00
|
|
|
# wkhtmltopdf
|
|
|
|
|
|
2025-07-24 22:27:13 -06:00
|
|
|
> Convert HTML documents or web pages into PDF files.
|
2025-03-14 21:59:59 -06:00
|
|
|
> More information: <https://wkhtmltopdf.org/>.
|
|
|
|
|
|
|
|
|
|
- Convert a HTML document into PDF:
|
|
|
|
|
|
|
|
|
|
`wkhtmltopdf {{input.html}} {{output.pdf}}`
|
|
|
|
|
|
|
|
|
|
- Specify the PDF page size (please see `PaperSize` of `QPrinter` for supported sizes):
|
|
|
|
|
|
|
|
|
|
`wkhtmltopdf --page-size {{A4}} {{input.html}} {{output.pdf}}`
|
|
|
|
|
|
|
|
|
|
- Set the PDF page margins:
|
|
|
|
|
|
|
|
|
|
`wkhtmltopdf --margin-{{top|bottom|left|right}} {{10mm}} {{input.html}} {{output.pdf}}`
|
|
|
|
|
|
|
|
|
|
- Set the PDF page orientation:
|
|
|
|
|
|
|
|
|
|
`wkhtmltopdf --orientation {{Landscape|Portrait}} {{input.html}} {{output.pdf}}`
|
|
|
|
|
|
|
|
|
|
- Generate a greyscale version of the PDF document:
|
|
|
|
|
|
|
|
|
|
`wkhtmltopdf --grayscale {{input.html}} {{output.pdf}}`
|