1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-06 18:55:26 +02:00
tldr/pages/common/wkhtmltopdf.md
Managor 23340cc6e0
common/*: reduce usage of "command-line" (part 1) (#16949)
Co-authored-by: Dylan <145150333+dmmqz@users.noreply.github.com>
Co-authored-by: Lena <126529524+acuteenvy@users.noreply.github.com>
2025-06-29 11:48:18 +03:00

695 B

wkhtmltopdf

Convert HTML documents or web pages into PDF files. 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}}