2018-10-02 11:12:47 +01:00
|
|
|
# weasyprint
|
|
|
|
|
|
|
|
> Render HTML to PDF or PNG.
|
2019-06-03 01:06:36 +01:00
|
|
|
> More information: <https://weasyprint.org/>.
|
2018-10-02 11:12:47 +01:00
|
|
|
|
2021-08-15 18:59:09 +01:00
|
|
|
- Render an HTML file to PDF:
|
2018-10-02 11:12:47 +01:00
|
|
|
|
2023-12-29 09:16:53 +00:00
|
|
|
`weasyprint {{path/to/input.html}} {{path/to/output.pdf}}`
|
2018-10-02 11:12:47 +01:00
|
|
|
|
2021-08-15 18:59:09 +01:00
|
|
|
- Render an HTML file to PNG, including an additional user stylesheet:
|
2018-10-02 11:12:47 +01:00
|
|
|
|
2023-12-29 09:16:53 +00:00
|
|
|
`weasyprint {{path/to/input.html}} {{path/to/output.png}} --stylesheet {{path/to/stylesheet.css}}`
|
2018-10-02 11:12:47 +01:00
|
|
|
|
|
|
|
- Output additional debugging information when rendering:
|
|
|
|
|
2023-12-29 09:16:53 +00:00
|
|
|
`weasyprint {{path/to/input.html}} {{path/to/output.pdf}} --verbose`
|
2018-10-02 11:12:47 +01:00
|
|
|
|
|
|
|
- Specify a custom resolution when outputting to PNG:
|
|
|
|
|
2023-12-29 09:16:53 +00:00
|
|
|
`weasyprint {{path/to/input.html}} {{path/to/output.png}} --resolution {{300}}`
|
2018-10-02 11:12:47 +01:00
|
|
|
|
2021-05-20 21:13:41 +01:00
|
|
|
- Specify a base URL for relative URLs in the input HTML file:
|
2018-10-02 11:12:47 +01:00
|
|
|
|
2023-12-29 09:16:53 +00:00
|
|
|
`weasyprint {{path/to/input.html}} {{path/to/output.png}} --base-url {{url_or_filename}}`
|