PDF函数库:PDF_add_annotation

PDF_add_annotation

加入注释。

语法: boolean pdf_add_annotation(int pdfid, double llx, double lly, double urx, double ury, string title, string content);

返回值: 布尔值

函数种类: 特殊文件格式

内容说明

本函数可将 PDF 档加入注释。参数 (llx, lly)、(urx, ury) 分别为左下及右上的 X, Y 坐标。参数 title 为注释的标题。参数 content 为注释字符串。

&">nbsp;   PDF 是 Adobe 所发展的可携式文件格式,它的文件可以在网络上传输、浏览,甚至使用印表机印出,或使用其它输出装置输出,都可以保存原来的文字及图片的编排。详细的信息可以参考 Adobe 的网站 。参考其中有关 PDF 或 Acrobat 的部份。
    在 UNIX 系统中,可以使用 Thomas Merz 开发的 PDF 函数库 。将它编译安装完成后,再编译 PHP 程序方可供 PHP 使用 pdflib。编译时可能要 JPEG library 及 TIFF library 。
    除了用这个函数库可以建立 PDF 文件外, FastIO 公司 发展的产品 ClibPDF 也可以处理 PDF 文件。以下为处理 PDF 文件的范例,本例对 test.pdf 加工后等待用户读取。

<?php
$fp = fopen ( "test.pdf" , "w" );
$pdf = PDF_open ( $fp );
pdf_set_info_author ( $pdf , "Uwe Steinmann" );
PDF_set_info_title ( $pdf , "Test for PHP wrapper of PDFlib 2.0" );
PDF_set_info_author ( $pdf , "Name of Author" );
pdf_set_info_creator ( $pdf , "See Author" );
pdf_set_info_subject ( $pdf , "Testing" );
PDF_begin_page ( $pdf , 595 , 842 );
PDF_add_outline ( $pdf , "Page 1" );
pdf_set_font ( $pdf , "Times-Roman" , 30 , 4 );
pdf_set_text_rendering ( $pdf , 1 );
PDF_show_xy ( $pdf , "Times Roman outlined" , 50 , 750 );
pdf_moveto ( $pdf , 50 , 740 );
pdf_lineto ( $pdf , 330 , 740 );
pdf_stroke ( $pdf );
PDF_end_page ( $pdf );
PDF_close ( $pdf );
fclose ( $fp );
echo "<A HREF=getpdf.php3>finished</A>" ;
?>

上例中的 gettest.php3 可能像下面的样子

<?php
$fp = fopen ( "test.pdf" , "r" );
header ( "Content-type: application/pdf" );
fpassthru ( $fp );
fclose ( $fp );
?>

时间: 2024-08-18 05:24:36

PDF函数库:PDF_add_annotation的相关文章

PDF函数库:PDF_open

PDF_open 建立新的 PDF 档. 语法: int pdf_open(int file, int info); 返回值: 整数 函数种类: 特殊文件格式 内容说明 本函数用来打开新的 PDF 文件,意即建立新的 PDF 档.参数 file 为使用 fopen() 所开档的文件代码.参数 info 为 PDF_get_info() 产生的 PDF 文件信息代码.成功则返回 PDF 文件代码.

PDF函数库:PDF_set_text_rise

PDF_set_text_rise 配置文字高度. 语法: boolean pdf_set_text_rise(int pdfid, double http://www.aliyun.com/zixun/aggregation/9541.html">value); 返回值: 布尔值 函数种类: 特殊文件格式 内容说明 本函数用来配置文字的高度.参数 pdfid 为 PDF 文件代码.参数 value 为欲配置的高度,为浮点数.

PDF函数库:PDF_close

PDF_close 关闭 PDF 档. 语法: boolean pdf_close(int pdfid); 返回值: 布尔值 函数种类: 特殊文件格式 &http://www.aliyun.com/zixun/aggregation/37954.html">nbsp;内容说明 本函数用来关闭 PDF 文件.参数 pdfid 为 PDF 文件代码.成功则返回 true 值.

PDF函数库:PDF_set_text_matrix

PDF_set_text_matrix 配置文字矩阵. 语法: boolean pdf_set_text_matrix(int pdfid, array matrix); 返回值: 布尔值 函数种类: 特殊文件格式 内容说明 本函数用来配置文字的矩阵.参数 pdfid 为 PDF 文件代码.参数 matrix 为数组,最多可有六个元素.

PDF函数库:PDF_begin_page

PDF_begin_page 启始 PDF 文件页面. 语法: boolean pdf_begin_page(int pdfid, double height, double width); 返回值: 布尔值 函数种类: 特殊文件格式 &http://www.aliyun.com/zixun/aggregation/37954.html">nbsp;内容说明 本函数用来启始 PDF 文件页面,并配置页面大小.参数 pdfid 为 PDF 文件代码.参数 height 与 width

PDF函数库:PDF_set_text_pos

PDF_set_text_pos 配置文字位置. 语法: boolean pdf_set_text_pos(int pdfid, double x-koor, double y-koor); 返回值: 布尔值 函数种类: 特殊文件格式 &http://www.aliyun.com/zixun/aggregation/37954.html">nbsp;内容说明 本函数用来配置文字的显示位置.参数 pdfid 为 PDF 文件代码.参数 x-koor 与 y-koor 均为浮点数,分别

PDF函数库:PDF_end_page

PDF_end_page 关闭 PDF 文件页面. 语法: boolean pdf_end_page(int pdfid); 返回值: 布尔值 函数种类: 特殊文件格式 &http://www.aliyun.com/zixun/aggregation/37954.html">nbsp;内容说明 本函数用来关闭 PDF 文件页面,并配置页面大小.参数 pdfid 为 PDF 文件代码.成功则返回 true 值.  参考 PDF_begin_page()

PDF函数库:PDF_set_char_spacing

PDF_set_char_spacing 配置字符间距. 语法: boolean pdf_set_char_spacing(int pdfid, double space); 返回值: 布尔值 函数种类: 特殊文件格式 &http://www.aliyun.com/zixun/aggregation/37954.html">nbsp;内容说明 本函数用来配置字符 (char) 的间距.参数 pdfid 为 PDF 文件代码.参数 space 为浮点数,为欲配置的距离.成功则返回 t

PDF函数库:PDF_get_info

PDF_get_info 返回文件信息. 语法: int pdf_get_info(); 返回值: 整数 函数种类: 特殊文件格式 内容说明 本函数用来取得 PDF 的文件信息,例如作者.主题....等等.需要 pdflib 2.0 以上才能使用本函数的功能. &http://www.aliyun.com/zixun/aggregation/37954.html">nbsp;参考 PDF_set_info_creator()  PDF_set_info_author()  PDF_