php致命错误:调用未定义的方法TCPDF :: addTTFfont()in

栏目: PHP · 发布时间: 6年前

内容简介:翻译自:https://stackoverflow.com/questions/28524074/php-fatal-error-call-to-undefined-method-tcpdfaddttffont-in

我正在使用TCPDF类来制作pdf文件.

我的代码:

$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$fontname = $pdf->addTTFfont('../common/pdf/fonts/persianFont/HiwebNazanin.ttf', 'TrueTypeUnicode', '', 32);
$pdf->SetFont($fontname, '', 12, '', 'false');

我想将默认字体更改为我的字体,并且在TCPDF文档中添加了toTTFfont方法.但我得到这个错误!!

Fatal error: Call to undefined method TCPDF::addTTFfont() in …

为什么我不能使用它?!!

在TCPDF(版本6.2.6)中使用:
require_once('/your_path_to/tcpdf.php');
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$fontname = TCPDF_FONTS::addTTFfont('../common/pdf/fonts/persianFont/HiwebNazanin.ttf', 'TrueTypeUnicode', '', 32);

翻译自:https://stackoverflow.com/questions/28524074/php-fatal-error-call-to-undefined-method-tcpdfaddttffont-in


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

The Little MLer

The Little MLer

Matthias Felleisen、Daniel P. Friedman、Duane Bibby、Robin Milner / The MIT Press / 1998-2-19 / USD 34.00

The book, written in the style of The Little Schemer, introduces instructors, students, and practicioners to type-directed functional programming. It covers basic types, quickly moves into datatypes, ......一起来看看 《The Little MLer》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具