Home > Web Front-end > HTML Tutorial > html2pdf 创建中文字体_html/css_WEB-ITnose

html2pdf 创建中文字体_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 09:08:10
Original
1809 people have browsed it

拷贝一个中文字体文件例如 simfang.ttf 复制到 tcpdf的 fonts\utils 下,切换到dos窗口,修改目录到这个utils目录下,执行如下命令:

> ttf2ufm -a -F simfang.ttf> php -q makefont.php simfang.ttf simfang.ufm false
Copy after login

utils文件下生成三个文件

simfang.ctg.z simfang.php simfang.z

将这三个文件拷贝到fonts目录下,就可以使用了。

include(html2pdf.class.php');    //引用html2pdf类$html2pdf = new HTML2PDF('L', 'A4', 'en', true, 'utf-8', array(0, 0, 0, 0));$html2pdf->pdf->SetDisplayMode('fullpage');$html2pdf->setDefaultFont('simfang');$html2pdf->writeHTML($content, false);  //$content为打印到pdf文档的内容$html2pdf->Output($filename,'D');        //$filename为下载下来的pdf文档名称
Copy after login



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template