php pdf functions,ClibPDF Functions

本文介绍了ClibPDF,一个用于PHP的PDF文档创建工具,它模仿了PDFlib的功能。特别强调了内存中创建PDF、无临时文件操作、页间修改以及与其他库的区别,如多文档支持和替代方案。初学者可通过示例了解如何开始使用ClibPDF,包括创建带有文本和样式的PDF。
摘要由CSDN通过智能技术生成

ClibPDF lets you create PDF documents with PHP. ClibPDF functionality

and API are similar to PDFlib.

This documentation should be read alongside the ClibPDF manual since it

explains the library in much greater detail.

Many functions in the native ClibPDF and the PHP module, as well

as in PDFlib, have the same name.

All functions except for cpdf_open() take the

handle for the document as their first parameter.

Currently this handle is not used internally since ClibPDF does

not support the creation of several PDF documents at the same time.

Actually, you should not even try it, the results are unpredictable. I

can't oversee what the consequences in a multi threaded environment

are. According to the author of ClibPDF this will change in one of

the next releases (current version when this was written is 1.10).

If you need this functionality use the pdflib module.

A nice feature of ClibPDF (and PDFlib) is the ability to create the pdf

document completely in memory without using temporary files. It

also provides the ability to pass coordinates in a predefined unit

length. (This feature can also be simulated by

pdf_translate() when using the PDFlib functions.)

Another nice feature of ClibPDF is the fact that any page can be modified

at any time even if a new page has been already opened. The function

cpdf_set_current_page() allows to leave the current

page and presume modifying an other page.

Most of the functions are fairly easy to use. The most difficult part

is probably creating a very simple PDF document at all. The following

example should help you to get started. It creates a document

with one page. The page contains the text "Times-Roman" in an

outlined 30pt font. The text is underlined.

注:

本扩展已被移动到 PECL 库中且自以下版本起不再被绑定到 PHP 中:5.1.0.

注:

If you're interested in alternative free PDF generators that do not

utilize external PDF libraries, see this related FAQ.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值