Print margins in DOMPDF

前端 未结 2 379
后悔当初
后悔当初 2021-01-03 18:29

I\'m trying to generate a PDF using DOMPDF. I have some HTML which is then converted into a PDF.

But I have a problem. When I put an object at the top of the page (e

2条回答
  •  伪装坚强ぢ
    2021-01-03 18:50

    The following style will effectively set the margins of your document to 0:

    @page { margin: 0px; }
    body { margin: 0px; }
    

    @page is used by dompdf 0.6.0, body by dompdf 0.5.1. You can modify the margin of the page and body independently, though right now the margin of the two together acts as your content bounds.

提交回复
热议问题