I have reproduced my problem below :
I draw a 210x297 rectangle on a web page
<!DOCTYPE html> <html> <style> div.rectangle { border: solid 1px; width: 210mm; height: 297mm; } </style> <head> </head> <body> <div class="rectangle"> <img/> </div> </body> </html>
I transform this html document to pdf with pdfkit in Python
import pdfkit options = { 'page-size':'A4', 'encoding':'utf-8', 'margin-top':'0cm', 'margin-bottom':'0cm', 'margin-left':'0cm', 'margin-right':'0cm' } pdfkit.from_file('test.html', 'test.pdf', options=options)
I obtain a pdf file with a rectangle at the top left corner whose size is roughly 5 times too small...
I would really appreciate if you can have a look !