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($pdfdoc300300);
if (
$font pdf_findfont($pdfdoc'Times-Roman''host'0)) {
  
pdf_setfont($pdfdoc$font10);
}
pdf_set_value($pdfdoc'textrendering'0);
pdf_add_note($pdfdoc10010018040'Note Content''Title''help'0);
pdf_show_xy($pdfdoc'Example'100100);
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;
?>