setasign/tfpdf
Composer 安装命令:
composer require setasign/tfpdf
包简介
This class is a modified version of FPDF that adds UTF-8 support. The latest version is based on FPDF 1.85.
README 文档
README
This repository is only made for cloning official tFPDF releases which are available at: http://fpdf.org/en/script/script92.php THERE WILL BE NO DEVELOPMENT IN THIS REPOSITORY!
The only change in this version is that the require_once() calls to font/unifont/ttfonts.php are commented and resolved through the composer autoloader. The demo ex.php was changed accordingly, too.
tFPDF accepts UTF-8 encoded text. It embeds font subsets allowing small PDF files.
It requires a folder 'unifont' as a subfolder of the 'font' folder.
You should make the 'unifont' folder writeable (CHMOD 755 or 644). Although this is not essential, it allows caching of the font metrics the first time a font is used, making subsequent uses much faster.
All tFPDF requires is a .ttf TrueType font file. The file should be placed in the 'unifont' directory. Optionally, you can also define the path to your system fonts e.g. 'C:\Windows\Font' (see the example ex.php file) and reference TrueType fonts in this directory.
Pass a fourth parameter as true when calling AddFont(), and use utf-8 encoded text when using Write() etc.
Installation with Composer
If you're using Composer to manage dependencies, you can use
$ composer require setasign/tfpdf:1.33
or you can include the following in your composer.json file:
{
"require": {
"setasign/tfpdf": "1.33"
}
}
Usage
Notice that tFPDF is not name-spaced. You can extend the class this way:
namespace your\namespace; class Document extends \tFPDF
or create an instance this way:
$pdf = new \tFPDF();
setasign/tfpdf 适用场景与选型建议
setasign/tfpdf 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7.33M 次下载、GitHub Stars 达 42, 最近一次更新时间为 2018 年 09 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「pdf」 「unicode」 「fpdf」 「tfpdf」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 setasign/tfpdf 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 setasign/tfpdf 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 setasign/tfpdf 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel 5 Package for Using & Working With Emojis
tfpdf
PHP Unicode library
Zawgyi and Unicode Font Detector and Converter
Country Flag Emoji for PHP
Extended FPDF
统计信息
- 总下载量: 7.33M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 43
- 点击次数: 22
- 依赖项目数: 38
- 推荐数: 1
其他信息
- 授权协议: LGPL-2.1
- 更新时间: 2018-09-05