From 7b6f488770a84a7f0928fa7cb77a320c2da1b3b5 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Tue, 2 Oct 2018 11:12:47 +0100 Subject: [PATCH] weasyprint: add page (#2367) --- pages/common/weasyprint.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 pages/common/weasyprint.md diff --git a/pages/common/weasyprint.md b/pages/common/weasyprint.md new file mode 100644 index 0000000000..7e1115b3b0 --- /dev/null +++ b/pages/common/weasyprint.md @@ -0,0 +1,23 @@ +# weasyprint + +> Render HTML to PDF or PNG. + +- Render a HTML file to PDF: + +`weasyprint {{path/to/input.html}} {{path/to/output}}.pdf` + +- Render a HTML file to PNG, including an additional user stylesheet: + +`weasyprint {{path/to/input.html}} {{path/to/output}}.png --stylesheet {{path/to/stylesheet.css}}` + +- Output additional debugging information when rendering: + +`weasyprint {{path/to/input.html}} {{path/to/output}}.pdf --verbose` + +- Specify a custom resolution when outputting to PNG: + +`weasyprint {{path/to/input.html}} {{path/to/output}}.png --resolution {{300}}` + +- Specify a base url for relative urls in the input HTML file: + +`weasyprint {{path/to/input.html}} {{path/to/output}}.png --base-url {{url_or_filename}}`