Forrest logo
back to the weasyprint tool

weasyprint:tldr:0c827

weasyprint: Specify a custom resolution when outputting to PNG.
$ weasyprint ${path-to-input-html} ${path-to-output}.png --resolution ${300}
try on your machine

This command is using a tool called WeasyPrint to convert an HTML file into a PNG image. Here's a breakdown of each part:

  1. weasyprint: This is the name of the command-line tool being executed.

  2. ${path-to-input-html}: This is a placeholder for the actual path to the input HTML file that you want to convert. You need to replace ${path-to-input-html} with the actual file path, for example, /path/to/input.html.

  3. ${path-to-output}.png: This is also a placeholder for the path and filename of the output PNG image file that will be generated. Like before, you should replace ${path-to-output} with the desired file path, e.g., /path/to/output.

  4. --resolution ${300}: This option sets the resolution of the output image to 300 dots per inch (dpi). You can replace 300 with any other desired value if needed.

So, when you run this command with actual file paths, it will take the specified input HTML file and convert it into a PNG image file at the specified output path, with the given resolution.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the weasyprint tool