rospdf/pdf-php
Composer 安装命令:
composer require rospdf/pdf-php
包简介
The R&OS Pdf class supports the creation of PDF documents without any adiditional modules or extensions.
README 文档
README
This is the official GIT clone from the R&OS PHP Pdf class previously stored on sourceforge.net/projects/pdf-php. Development will take place here now.
The R&OS Pdf class is used to generate PDF Documents using PHP without installing any additional modules or extensions It comes with a base class called "Cpdf.php" plus a helper class "Cezpdf.php" to generate tables, add backgrounds and provide paging.
DOCUMENTATION : WEBSITE : CONTRIBUTINGFeatures
- Quick and easy to use
- Support for extension classes
- Unicode and ANSI formatted text
- Custom TTF fonts and font subsetting (version >= 0.11.8)
- Auto page and line breaks
- Text alignments (left, right, center, justified)
- Linked XObjects
- Internal and external links
- Compression by using gzcompress
- Encryption 40bit, 128bit since PDF 1.4
- Image support for JPEG, PNG and GIF (partly)
- Template support
Installation
Manual Download
Open the RELEASE page and pick the latest version to download.
Extract the archive into your project directory
Clone via git
You can also use git to install it using:
git clone https://github.com/rospdf/pdf-php.git
git checkout <latest-version>
Installation via composer
This library is also available on the dependency manager composer - https://packagist.org/packages/rospdf/pdf-php
Please follow the steps here to install. Once this is done one simple command will get all dependencies for the package rospdf/pdf-php
./composer.phar require rospdf/pdf-php
For more details on how to use composer please refer to the documentation - https://getcomposer.org/doc/
Example
<?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]); ?>
Contributors
ole1986 is lead developer.
See the full list of contributors.
rospdf/pdf-php 适用场景与选型建议
rospdf/pdf-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.52M 次下载、GitHub Stars 达 149, 最近一次更新时间为 2016 年 05 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 rospdf/pdf-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 rospdf/pdf-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 1.52M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 152
- 点击次数: 17
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-05-13
