如何使用Codeigniter应用tcpdf tamil字体 [英] How to apply tcpdf tamil font by using codeigniter

查看:63
本文介绍了如何使用Codeigniter应用tcpdf tamil字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我应用以下行:

 $pdf->SetFont('freeserif', '', 14, '', true); 

但我没有得到确切的输出。

but my not getting the exact output.

推荐答案

使用TCPDF库时,可以通过继承TCPDF类来创建类:

when using TCPDF library you can make your class by inherit from TCPDF class:

class MYPDF extends TCPDF {

您可以覆盖页脚 header 函数可以根据需要在这些函数中进行设置。但是TCPDF包含一些字体,如果要添加新字体,则必须下载它并将其解压缩到 tcpdf / fonts / utils 文件夹中,然后通过以下方式使用它:

you can override the footer and header function as you like, and inside these functions you can set your font. but TCPDF contains some fonts if you want add new font you must download it and extract it in tcpdf/fonts/utils folder and use it by this way:

$ge_hili_light = $this->addTTFfont(MAIN_DOCUMENT_ROOT .
'/includes/tcpdf/fonts/utils/ge-hili-light.ttf', 'TrueTypeUnicode', '', 32);
$this->SetFont($ge_hili_light, 'B', 12, "", false);

其中 $ this 是指 MYPDF 类,它从 TCPDF

这篇关于如何使用Codeigniter应用tcpdf tamil字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆