【发布时间】:2018-07-11 12:41:08
【问题描述】:
我想从我的 HTML 脚本生成 PDF。现在脚本是
<?php
require_once __DIR__ . '/vendor/autoload.php';
$mpdf = new \Mpdf\Mpdf();
$mpdf->WriteHTML('<div class="pageContatiner noSelect ui-droppable slctCon"><div onmousedown="objSelection(this)" ontouchstart="objSelection(this)" id="pmObj-1" class="shape obj" style="width: 136.217px; height: 136.217px; position: absolute; transform: matrix(-0.491017, -0.87115, 0.87115, -0.491017, 0, 0); margin-left: 312px; margin-top: 99px;" x="330" y="117" angle="240.59253473738065" scalex="1" scaley="1"><svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" height="136.2166748046875" width="136.2166748046875"><polygon class="svgObj" fill="rgba(51,122,183,1)" stroke="rgba(51,122,183,0.99)" stroke-width="1" points="96,100 50,5 4,100" width="136.2166748046875" height="136.2166748046875"></polygon></svg></div></div>');
$mpdf->Output();
?>
但问题是三角形图标显示没有旋转。
【问题讨论】:
-
你想试试 PrinceXML (princexml.com) 吗?
-
@IVOGELOV 如果您有任何将 html 转换为 pdf 的示例脚本,请发给我吗?
标签: php mpdf html-to-pdf