PHP 手册
后退 |  | 前进

# pdf_add_note

(PHP 4 >= 4.0.5, PECL)

pdf_add_note -- Sets annotation for current page

## Description

bool pdf_add_note ( resource pdfdoc, float llx, float lly, float urx, float ury, string contents, string title, string icon, int open )

Sets an annotation for the current page. icon is one of comment, insert, note, paragraph, newparagraph, key, or help. 如果成功则返回 `TRUE`，失败则返回 `FALSE`。

例子 1. Adding a note to a PDF document with PDFlib

`<?php
$pdfdoc = pdf_new();
if (!pdf_open_file($pdfdoc, '')) {
echo 'error!';
exit;
}
pdf_begin_page($pdfdoc, 300, 300);
if ($font = pdf_findfont($pdfdoc, 'Times-Roman', 'host', 0)) {
pdf_setfont($pdfdoc, $font, 10);
}
pdf_set_value($pdfdoc, 'textrendering', 0);
pdf_add_note($pdfdoc, 100, 100, 180, 40, 'Note Content', 'Title', 'help', 0);
pdf_show_xy($pdfdoc, 'Example', 100, 100);
pdf_end_page($pdfdoc);
pdf_close($pdfdoc);
$data = pdf_get_buffer($pdfdoc);
header('Content-type: application/pdf');
header('Content-disposition: inline; filename=example.pdf');
header('Content-length: '.strlen($data));
echo $data;
?>`

后退 | 起点 | 前进
pdf_add_locallink | 上一级 | pdf_add_outline