Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can use the --page-width and --page-height options to set the width and height of the page, respectively. To ensure that the output fits the full width of the page, you should set the page width to be the same as the width of the content in your HTML file. For example, if your content is 800px wide, you can use the following command:

wkhtmltopdf --page-width 800px input.html output.pdf

You can also use the --zoom option to adjust the scale of the output. For example, if you want the output to be 90% of the original size, you can use the following command:

wkhtmltopdf --zoom 0.9 input.html output.pdf

Note that the --zoom option may affect the quality of the output, so you may need to experiment with different values to find the optimal setting.