我在我的网页上展示了一个HTML表格,在其中正确显示了一个勾选标记(我使用✔
来表示粗体勾选标记)。
我使用classic-asp来显示HTML。然后将html组成(tableOutput)发布到一个PHP脚本($output = $_POST["output"]),该脚本使用mPDF.php(版本6.0)打印相同的HTML表格,但是勾选标记无法正确打印(在我的PDF上输出%u2714)。所有其余表格都正确打印,只有勾选标记有问题。
我尝试将Symbola.ttf和Symbola_hint.ttf字体添加到mpdf\ttfonts文件夹中,但这并没有起作用。
HTML(classic-asp):
tableOutput = tableOutput & "<TD class='center pass_x' style='font-family:symbola;'>✔</TD>"
PHP(create_report_pdf.php):
$output = $_POST["output"]; //This is the html buildup tableOutput discussed previously
$header = Irrelevant;
$footer= Irrelevant;
$mpdf = new mPDF( 'utf-8', 'A4-L', 0, '', 5, 5, 20, 20);
$mpdf->allow_charset_conversion = true;
$mpdf->WriteHTML($style,1);
$mpdf->SetHTMLHeader( $header );
$mpdf->SetHTMLFooter( $footer );
$mpdf->WriteHTML( $output );
$mpdf->Output($temp ,'F' );
config_fonts.php(我将symbola.ttf和Symbola_hint.ttf添加到mpdf\ttfonts文件夹中):
$this->fontdata = array (
"symbola" => array (
'R' => "Symbola.ttf",
'I' => "Symbola_hint.ttf",
),
CSS(PHP $style变量指向create_report_pdf.css):
.report-table{
border: 1px solid black;
border-collapse: collapse;
font-size: 7pt;
width: 100%;
}
th,td{
font-size: 7pt;
border: 1px solid black !important;
vertical-align : middle;
}
.center{ text-align: center; vertical-align: middle; }
INPUT{
border-color:#ffffff !important;
}
.pf{ width: 45px; }
.fix-cell{ width: 90px; }
.dr-column, .dr-input{ width: 100px; }
.comments, .comments-input{ width: 130px; }
非常感谢您的帮助。