问题描述
乡亲们!
我正在使用useActiveForms属性从使用mpdf库的HTML复选框输入中生成pdf。
问题在于,单击复选框时,复选框永远不会被打勾-出现轮廓,仅此而已。
顺便说一句,所有其他输入都可以正常工作-文本输入,单选按钮,选择-但我需要这个复选框!
在浏览器google chrome和pdf-xchange查看器中发现了该问题,但在更新的Adobe Acrobat Reader DC和Foxit Reader中都可以正常工作。
我翻遍了整个网络,发现要么我一个人就有这样的问题,要么不知道该怎么想!
如果有人为浏览器提供任何决定,将有义务吗?
我的代码如下:
<?PHP
require_once 'mpdf/vendor/autoload.PHP';
ob_start();
?>
<!doctype html>
<html lang="en">
<head>
<title>Your form</title>
</head>
<body>
<form>
<input type="checkBox" name="check" checked="checked" value="rrrrr"> check me <br />
<input type="text" name="text" value="" />
</form>
</body>
</html>
<?PHP
$form = ob_get_contents();
ob_end_clean();
$mpdf = new \Mpdf\Mpdf([
'margin_left' => 5,'margin_right' => 5,'margin_top' => 5,'margin_bottom' => 5,'margin_header' => 0,'margin_footer' => 0
]);
$mpdf->useActiveForms = true;
$mpdf->SetTitle("CheckBox test");
$mpdf->SetAuthor("John Doe");
$mpdf->SetdisplayMode(100);
$mpdf->WriteHTML($form);// this generates the pdf
$tmpfile = tempnam(sys_get_temp_dir(),'pdf_');
$mpdf->Output($tmpfile,'F');
header('Content-Type: application/octet-stream');
header('Content-disposition: attachment; filename="checks.pdf"');
readfile($tmpfile);
?>
谢谢!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)