I am using PHP, Mysql, jQuery. I have a webpage that is to be converted into high-res A4 size PDF: http://optisolbusiness.com/funeral_site/sample/index/id/255.
I have converted the HTML to PDF using wkhtmltopdf
, which works great.
Here is the generated PDF http://optisolbusiness.com/Guru/Gurupdf/optisol.pdf. But the HTML is not fitting exactly to PDF size; There are spaces around the HTML in PDF. How to scale HTML to fit A4 PDF size 100%? Importantly the content inside the html (ie) text size, images width and height, background images also to be scaled proportionally.
Your background image is not exactly high-res, this won't look great in print.
I don't know wkhtmltopdf itself, but your body already has absolute dimensions set (in inches). This is probably the problem. Your body has a max size, the content has an absolute size too (given due to the background image pixel dimensions).
This is not a good starting point for html-to-print transformaions, and PDF is essentially print.
what to do (intermediate)
zoom
, 1.5
should be an appropriate value to fill the pagewhat to do (the "right" way)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With