php 如何在 mPDF 中设置自定义页面大小?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23663501/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to set custom page size in mPDF?
提问by ZaquPL
I need some help with mPDF. I want to set up my custom page size (exactly: width 49mm and height 200mm), but I can not find solution. I found mPDF() manual (http://mpdf1.com/manual/index.php?tid=184) but there are only ready formats like A4, B5 etc. I have to set up my own page format.
我需要一些有关 mPDF 的帮助。我想设置我的自定义页面大小(确切地说:宽 49 毫米和高 200 毫米),但我找不到解决方案。我找到了 mPDF() 手册 ( http://mpdf1.com/manual/index.php?tid=184) 但只有 A4、B5 等现成的格式。我必须设置自己的页面格式。
回答by Brian Tiffin
There is an example that shows how to initiate the page with width and height.
有一个示例显示了如何使用宽度和高度启动页面。
// Define a page size/format by array - page will be 190mm wide x 236mm height
$mpdf=new mPDF('utf-8', array(190,236));