我正在使用DomPDF生成PDF文件.这可以正常工作,但是我想设置打开文档时使用的默认页面布局.我想在查看文档时拥有100%的视图.实际上,页面已拉伸到窗口的最大宽度.有人知道如何将页面布局设置为单个站点"的解决方案吗?
I am using DomPDF to generate PDF-Files. This works fine, but I want to set the default page layout which is used by opening the document. I want to have a 100% view when the document is viewed. Actually the page is streched to the max width of the window. Does anybody know a solution how to set the page layout to "single site"?
关于,洛思隆(Lothron)
Regards, Lothron
推荐答案您可以在dompdf中执行此操作,方法是在meta元素中指定视图,例如
You can do this in dompdf by specifying the view in a meta element, e.g.
<meta name="dompdf.view" content="FitV" />或
<meta name="dompdf.view" content="XYZ,0,0,1" />您还可以调用画布类的 set_default_view()方法,例如
You can also call the set_default_view() method of the canvas class, e.g.
$dompdf->get_canvas()->set_default_view('FitV')只能在实例化PDF文档之后才能使用上述方法.从dompdf 0.6.1开始,这是在调用 $ dompdf-&r; render()之后完成的.
Using the above method can only be done after the PDF document has been instantiated. As of dompdf 0.6.1 that is done after calling $dompdf->render().
引用: groups.google/d/msg/dompdf/7L2xMLwmH-Y/Et2mBNny51QJ
更多推荐
使用DomPDF设置PDF文件的默认页面布局
发布评论