Customized width and height in DOMPDF

邮差的信 提交于 2019-12-01 05:20:26

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');

greut

DOMPDF handles the paper size via the configuration.

define ("DOMPDF_DEFAULT_PAPER_SIZE", "letter");

You can referrer to all available sizes there:

https://github.com/dompdf/dompdf/blob/2eaf8fe0f1c95ab76e7a428a39a54dd240e2b2ec/src/Adapter/CPDF.php#L40

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!