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.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2022-06-19 11:00:00 +0000
Seen: 7 times
Last updated: Apr 18 '22
How to ensure a page break when creating Velocity HTML resumes?
How can I prevent the LeafletJS page from jumping when a layer is clicked?
What is the method to remove a particular page from the directory layout of a NextJS 13 application?
What is the reason that my controller is providing an HTML page instead of JSON?
What causes elements to move on the page during page loading through transitions?
What does the HTTP 404 error message mean?
Is it impossible to navigate to a specific page in AppSync List Query Pagination?
How can I create a page that includes all the required details using React JS?