Customized width and height in DOMPDF

后端 未结 2 1895
萌比男神i
萌比男神i 2021-01-13 12:29

Is there anyway i can set the generated PDF\'s width and height? i want to customized the width and height of the PDF. Normally it would be on a size of a short bond paper b

2条回答
  •  盖世英雄少女心
    2021-01-13 12:58

    You can set your own format, without having to change DOMPDF code, by passing an array when you're calling DOMPDF::set_paper(). Make sure it contains the width and the height in points, like this:

    $dompdf->set_paper(array(0, 0, 595, 841), 'portrait');

提交回复
热议问题