简体   繁体   English

DOMPDF卡在信纸尺寸上

[英]DOMPDF Stuck on Letter Paper Size

I'm using DOMPDF on a little web app I'm building. 我在我正在构建的一个小型Web应用程序上使用DOMPDF。 It's working great apart from it's stuck on the default paper size of 'US Letter' no matter where I change it. 它的工作效果很好,除非我更改了它,否则它会停留在“US Letter”的默认纸张尺寸上。

Any ideas? 有任何想法吗?

// dompdf_config.inc.php
def("DOMPDF_DEFAULT_PAPER_SIZE", "a4");

Are you correctly calling the 'set_paper' method in your pdf creation as follows : 您是否正确地在pdf创建中调用'set_paper'方法,如下所示:

$dompdf->set_paper(DEFAULT_PDF_PAPER_SIZE, 'portrait');

Furthermore, you can define your own paper size if this is still not working using something along the lines of the following : 此外,如果仍然无法使用以下内容,您可以定义自己的纸张尺寸:

$paper_size = array(0,0,360,360);
$dompdf->set_paper($paper_size);

上面没有帮助我仍然坚持信以下做了工作(来自DOMPDF FAQ)

$dompdf->set_paper("A4", "portrait");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM