weasyprint

Render HTML to PDF or PNG. More information: https://weasyprint.org/.

weasyprint path/to/input.html path/to/output.pdf

weasyprint path/to/input.html path/to/output.png --stylesheet path/to/stylesheet.css

weasyprint path/to/input.html path/to/output.pdf --verbose

weasyprint path/to/input.html path/to/output.png --resolution 300

weasyprint path/to/input.html path/to/output.png --base-url url_or_filename