我有一个简单的表单,我想使用 php 使其可以在 pdf 中编辑。但是 pdf 正在创建表单,但我无法编辑和提交它,有什么原因或者我无法使用 php 编辑 pdf?
我的代码是
<?php
define('_MPDF_PATH','/');
include("mpdf.php");
$html = '
<form action="test.php">
<input type="text" id="name" value="name" />
<input type="reset" name="reset" value="Reset" />
<input type="submit" name="submit" value="Submit" />
</form>';
$mpdf=new mPDF('c');
$mpdf->default_lineheight_correction = 1.2;
// LOAD a stylesheet
$stylesheet = file_get_contents('mpdfstyletables.css');
$mpdf->WriteHTML($stylesheet,1); // The parameter 1 tells that this is css/style only and no body/html/text
$mpdf->SetColumns(2,'J');
$mpdf->WriteHTML($html);
$mpdf->Output('test.pdf','D');//
exit;
?>
我在用着mPDF 示例网址 https://github.com/mpdf/mpdf-examples and 表格示例 https://github.com/mpdf/mpdf-examples/blob/development/example09_forms.php
您还可以使用TCPDF。 TCPDF是一个免费开源软件 PHP 类,用于生成 PDF 文档。 TCPDF 是唯一一个基于 PHP 的库,完全支持 UTF-8 Unicode 和从右到左的语言,包括双向算法。
访问该链接以获取更多信息。http://www.tcpdf.org/ http://www.tcpdf.org/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)