Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a command to set wkhtmltopdf options #418

Open
javila opened this issue Dec 11, 2024 · 3 comments
Open

Creating a command to set wkhtmltopdf options #418

javila opened this issue Dec 11, 2024 · 3 comments

Comments

@javila
Copy link
Contributor

javila commented Dec 11, 2024

Hi!

Would it be possible to create a #wkhtmltopdf to allow the user to pass custom options to wkhtmltopdf program? This options string could be appended to the string variable s in Converter.cs (line 62). The default values could still be kept in the variable s and the new options would be appended to it.

This way, the user could set new margins to the generated PDF with:
#wkhtmltopdf --margin-bottom 15 --margin-left 15 --margin-right 15 --margin-top 15

Right now, my workaround is saving the HTML contents and running the wkhtmltopdf command manually. By the way, there should be an option in Calcpad that forbid it to open the HTML/PDF files every time you save them.

@Proektsoftbg
Copy link
Owner

Hi!

Or you can use a free pdf printer like CutePDF and set the margins in the print preview dialog?

@javila
Copy link
Contributor Author

javila commented Dec 12, 2024

Hi, Ned!

That's true. But it was just an example. I was more interested in header/footer wkhtmltopdf command options (like --header-html and others). I suppose using --header-html (instead of using tables like I saw in an example) may generate PDFs with nice headers.

@Proektsoftbg
Copy link
Owner

Hi! OK, thank you! Now I see your point. Yes, it can be very useful for anyone who is familiar with wkhtmltopdf options and it is easy to implement. So, I will include it. Also, it is a good idea about the header-html option. I will have a closer look to it. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants