rospdf / pdf-php
R&OS Pdf类支持在不安装任何额外模块或扩展的情况下创建PDF文档。
0.12.67
2023-04-20 20:52 UTC
Requires
- php: >=5.6.0
Requires (Dev)
- dev-master / 0.12.x-dev
- 0.12.67
- 0.12.66
- 0.12.65
- 0.12.64
- 0.12.63
- 0.12.62
- 0.12.61
- 0.12.60
- 0.12.58
- 0.12.57
- 0.12.56
- 0.12.55
- 0.12.54
- 0.12.53
- 0.12.52
- 0.12.51
- 0.12.50
- 0.12.49
- 0.12.48
- 0.12.47
- 0.12.46
- 0.12.45
- 0.12.44
- 0.12.43
- 0.12.42
- 0.12.41
- 0.12.40
- 0.12.39
- 0.12.38
- 0.12.37
- 0.12.36
- 0.12.35
- 0.12.34
- 0.12.33
- 0.12.32
- 0.12.31
- 0.12.30
- 0.12.29
- 0.12.28
- 0.12.27
- 0.12.26
- 0.12.25
- 0.12.24
- 0.12.23
- 0.12.22
- 0.12.21
- 0.12.20
- dev-experimental
This package is auto-updated.
Last update: 2024-09-20 23:44:05 UTC
README
这是从之前存储在sourceforge.net/projects/pdf-php/上的R&OS PHP Pdf类官方GIT克隆的版本。现在开发将在这里进行。
R&OS Pdf类用于使用PHP生成PDF文档,无需安装任何额外模块或扩展。它包含一个名为"Cpdf.php"的基类以及一个名为"Cezpdf.php"的辅助类,用于生成表格、添加背景并提供分页。
文档:网站:贡献特性
- 快速且易于使用
- 支持扩展类
- Unicode和ANSI格式文本
- 自定义TTF字体和字体子集(版本>=0.11.8)
- 自动页面和行中断
- 文本对齐(左、右、居中、两端对齐)
- 链接XObjects
- 内部和外部链接
- 使用gzcompress进行压缩
- 加密40位,自PDF 1.4起支持128位
- 支持JPEG、PNG和GIF图像(部分)
- 模板支持
安装
手动下载
打开版本页面,下载最新版本。
将存档解压到您的项目目录中
通过git克隆
您也可以使用git通过以下命令安装:
git clone https://github.com/rospdf/pdf-php.git
git checkout <latest-version>
通过composer安装
此库也位于依赖管理器composer
上 - https://packagist.org.cn/packages/rospdf/pdf-php
请按照此处的步骤进行安装。完成后,只需一个简单的命令即可获取包rospdf/pdf-php
的所有依赖项。
./composer.phar require rospdf/pdf-php
有关如何使用composer
的更多详细信息,请参阅文档 - https://getcomposer.org.cn/doc/
示例
<?php include 'src/Cezpdf.php'; // Or use 'vendor/autoload.php' when installed through composer // Initialize a ROS PDF class object using DIN-A4, with background color gray $pdf = new Cezpdf('a4','portrait','color',[0.8,0.8,0.8]); // Set pdf Bleedbox $pdf->ezSetMargins(20,20,20,20); // Use one of the pdf core fonts $mainFont = 'Times-Roman'; // Select the font $pdf->selectFont($mainFont); // Define the font size $size=12; // Modified to use the local file if it can $pdf->openHere('Fit'); // Output some colored text by using text directives and justify it to the right of the document $pdf->ezText("PDF with some <c:color:1,0,0>blue</c:color> <c:color:0,1,0>red</c:color> and <c:color:0,0,1>green</c:color> colours", $size, ['justification'=>'right']); // Output the pdf as stream, but uncompress $pdf->ezStream(['compress'=>0]); ?>
贡献者
ole1986是主要开发者。
查看完整的贡献者列表。