PhpDig.net

What is PhpDig?
PhpDig is a PHP MySQL based
Web Spider & Search Engine.




pdf_add_note

Name

pdf_add_note — Sets annotation

Synopsis

int pdf_add_note(pdf, llx, lly, urx, ury, contents, title, icon, open);
resource pdf: PDF object identifier
double llx: Lower left x coordinate
double lly: Lower left y coordinate
double urx: Upper right x coordinate
double ury: Upper right y coordinate
string contents: Note contents
string title: Note title
string icon: Icon type
int open: Note state

Returns

Always TRUE

Description

Creates a note in the PDF documents. Notes in PDF documents are the equivalent of sticky notes and can be used to add comments and small items of information to a document.

The size of the note is determined by the bounding box starting at the lower left coordinates llx , lly and ending at the upper right coordinates urx , ury . contents sets the textual content of the note, while title is the text that appears in the title bar when the note is opened. icon sets the type of note icon that is displayed when the note is closed. These can be either "comment", "insert", "note", "paragraph", "newparagraph", "key" or "help". If open is 0 the note is displayed closed or if note is set to 1, the note is displayed as open.

Warning

Different icons are not supported if Acrobat 3 compatibility mode is set using pdf_set_value() .

Unix based Acrobat readers may only display the note icon even if another icon type has been specified.

Version

Since version 4.0.5

Example

Example 908. Create two notes

<?php

// create new document
$pdf = pdf_new();
pdf_open_file($pdf);
pdf_begin_page($pdf, 500, 700);

// add first note type
pdf_add_note($pdf, 50, 650, 80, 610, "Some contents", "Here's one",  "key", 0);

// add second note type
pdf_add_note($pdf, 100, 600, 130, 570, "Some more contents", "Here's another",  "help", 0);

pdf_end_page($pdf);
pdf_close($pdf);

// display PDF document
$data = pdf_get_buffer($pdf);
header("Content-type: application/pdf");
header("Content-disposition: inline; filename=test.pdf");
header("Content-length: " . strlen($data));
echo $data;
?>



PHP Functions Essential Reference. Copyright © 2002 by New Riders Publishing (Authors: Zak Greant, Graeme Merrall, Torben Wilson, Brett Michlitsch). This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/). The authors of this book have elected not to choose any options under the OPL. This online book was obtained from http://www.fooassociates.com/phpfer/ and is designed to provide information about the PHP programming language, focusing on PHP version 4.0.4 for the most part. The information is provided on an as-is basis, and no warranty or fitness is implied. All persons and entities shall have neither liability nor responsibility to any person or entity with respect to any loss or damage arising from the information contained in this book.

Powered by: vBulletin Version 3.0.7
Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.