2
Je reproduis mon problème ci-dessous:PDFKit - Une page A4 html n'imprime pas dans une A4 pdf
Je dessine un rectangle 210x297 sur une page web
<!DOCTYPE html> <html> <style> div.rectangle { border: solid 1px; width: 210mm; height: 297mm; } </style> <head> </head> <body> <div class="rectangle"> <img/> </div> </body> </html>
Je transforme cette document html au format PDF avec PDFKit en 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)
-je obtenir un fichier pdf avec un rectangle en haut coin gauche dont la taille est à peu près 5 fois trop petite ...
J'apprécierais vraiment si vous pouvez jeter un oeil!
Quel OS avez-vous? J'ai le même problème sur le macOS. –