wkhtmltopdf css sizes in cm/mm

前端 未结 3 1244
眼角桃花
眼角桃花 2021-02-12 11:54

I use wkhtmltopdf to produce A4 sized PDFs. When I create a

tag and set its style to height: 297mm; width: 210mm (which is the defined size
相关标签:
3条回答
  • 2021-02-12 12:03

    Perhaps try increasing the height of the <div> a fraction of a mm?

    height: 297.5mm or height: 298mm instead?

    Let me know if that works.

    0 讨论(0)
  • 2021-02-12 12:19

    Try set <div> element style="margin: 0;" in my case this helps...

    0 讨论(0)
  • 2021-02-12 12:22

    I had a method that worked for me that used margins.

    style="margin:0,auto"
    

    If that doesn't work try:

    style="margin:0,auto,0,auto"
    
    0 讨论(0)
提交回复
热议问题