1 <?xml version="1.0" encoding="UTF-8"?>
3 <sect1 id="zend.pdf.interactive-features">
4 <title>Interactive Features</title>
6 <sect2 id="zend.pdf.pages.interactive-features.destinations">
7 <title>Destinations</title>
10 A destination defines a particular view of a document, consisting of the following
16 <para>The page of the document to be displayed.</para>
20 <para>The location of the document window on that page.</para>
24 <para>The magnification (zoom) factor to use when displaying the page.</para>
29 Destinations may be associated with outline items (<link
30 linkend="zend.pdf.pages.interactive-features.outlines">Document
31 Outline (bookmarks)</link>), annotations (<link
32 linkend="zend.pdf.pages.interactive-features.annotations">Annotations</link>), or
33 actions (<link linkend="zend.pdf.pages.interactive-features.actions">Actions</link>).
34 In each case, the destination specifies the view of the document to be presented
35 when the outline item or annotation is opened or the action is performed. In addition,
36 the optional document open action can be specified.
39 <sect3 id="zend.pdf.pages.interactive-features.destinations.types">
40 <title>Supported Destination Types</title>
43 The following types are supported by <classname>Zend_Pdf</classname> component.
46 <sect4 id="zend.pdf.pages.interactive-features.destinations.types.zoom">
47 <title>Zend_Pdf_Destination_Zoom</title>
50 Display the specified page, with the coordinates (left, top) positioned at
51 the upper-left corner of the window and the contents of the page magnified
56 Destination object may be created using
57 <methodname>Zend_Pdf_Destination_Zoom::create($page, $left = null, $top = null,
58 $zoom = null)</methodname>
69 <varname>$page</varname> is a destination page
70 (a <classname>Zend_Pdf_Page</classname> object or a page number).
76 <varname>$left</varname> is a left edge of the displayed page (float).
82 <varname>$top</varname> is a top edge of the displayed page (float).
88 <varname>$zoom</varname> is a zoom factor (float).
94 <constant>NULL</constant>, specified for <varname>$left</varname>,
95 <varname>$top</varname> or <varname>$zoom</varname> parameter means
96 "current viewer application value".
100 <classname>Zend_Pdf_Destination_Zoom</classname> class also provides
101 the following methods:
106 <para><type>Float</type><methodname>getLeftEdge()</methodname>;</para>
110 <para><methodname>setLeftEdge(float $left)</methodname>;</para>
114 <para><type>Float</type><methodname>getTopEdge()</methodname>;</para>
118 <para><methodname>setTopEdge(float $top)</methodname>;</para>
122 <para><type>Float</type><methodname>getZoomFactor()</methodname>;</para>
126 <para><methodname>setZoomFactor(float $zoom)</methodname>;</para>
131 <sect4 id="zend.pdf.pages.interactive-features.destinations.types.fit">
132 <title>Zend_Pdf_Destination_Fit</title>
135 Display the specified page, with the coordinates (left, top) positioned at
136 the upper-left corner of the window and the contents of the page magnified
138 Display the specified page, with its contents magnified just enough to fit
139 the entire page within the window both horizontally and vertically. If
140 the required horizontal and vertical magnification factors are different, use
141 the smaller of the two, centering the page within the window in the other
146 Destination object may be created using
147 <methodname>Zend_Pdf_Destination_Fit::create($page)</methodname>
152 Where <varname>$page</varname> is a destination page
153 (a <classname>Zend_Pdf_Page</classname> object or a page number).
157 <sect4 id="zend.pdf.pages.interactive-features.destinations.types.fit-horizontally">
158 <title>Zend_Pdf_Destination_FitHorizontally</title>
161 Display the specified page, with the vertical coordinate top positioned at
162 the top edge of the window and the contents of the page magnified just enough
163 to fit the entire width of the page within the window.
167 Destination object may be created using
168 <methodname>Zend_Pdf_Destination_FitHorizontally::create($page,
169 $top)</methodname> method.
179 <varname>$page</varname> is a destination page
180 (a <classname>Zend_Pdf_Page</classname> object or a page number).
186 <varname>$top</varname> is a top edge of the displayed page
193 <classname>Zend_Pdf_Destination_FitHorizontally</classname> class also
194 provides the following methods:
199 <para><type>Float</type><methodname>getTopEdge()</methodname>;</para>
203 <para><methodname>setTopEdge(float $top)</methodname>;</para>
208 <sect4 id="zend.pdf.pages.interactive-features.destinations.types.fit-vertically">
209 <title>Zend_Pdf_Destination_FitVertically</title>
212 Display the specified page, with the horizontal coordinate left positioned
213 at the left edge of the window and the contents of the page magnified just
214 enough to fit the entire height of the page within the window.
218 Destination object may be created using
219 <methodname>Zend_Pdf_Destination_FitVertically::create($page,
220 $left)</methodname> method.
230 <varname>$page</varname> is a destination page
231 (a <classname>Zend_Pdf_Page</classname> object or a page number).
237 <varname>$left</varname> is a left edge of the displayed page
244 <classname>Zend_Pdf_Destination_FitVertically</classname> class also
245 provides the following methods:
250 <para><type>Float</type><methodname>getLeftEdge()</methodname>;</para>
254 <para><methodname>setLeftEdge(float $left)</methodname>;</para>
259 <sect4 id="zend.pdf.pages.interactive-features.destinations.types.fit-rectangle">
260 <title>Zend_Pdf_Destination_FitRectangle</title>
263 Display the specified page, with its contents magnified just enough to fit
264 the rectangle specified by the coordinates left, bottom, right, and top
265 entirely within the window both horizontally and vertically. If the required
266 horizontal and vertical magnification factors are different, use the smaller
267 of the two, centering the rectangle within the window in the other dimension.
271 Destination object may be created using
272 <methodname>Zend_Pdf_Destination_FitRectangle::create($page, $left, $bottom,
273 $right, $top)</methodname> method.
283 <varname>$page</varname> is a destination page
284 (a <classname>Zend_Pdf_Page</classname> object or a page number).
290 <varname>$left</varname> is a left edge of the displayed page
297 <varname>$bottom</varname> is a bottom edge of the displayed page
304 <varname>$right</varname> is a right edge of the displayed page (float).
310 <varname>$top</varname> is a top edge of the displayed page (float).
316 <classname>Zend_Pdf_Destination_FitRectangle</classname> class also
317 provides the following methods:
322 <para><type>Float</type><methodname>getLeftEdge()</methodname>;</para>
326 <para><methodname>setLeftEdge(float $left)</methodname>;</para>
330 <para><type>Float</type><methodname>getBottomEdge()</methodname>;</para>
334 <para><methodname>setBottomEdge(float $bottom)</methodname>;</para>
338 <para><type>Float</type><methodname>getRightEdge()</methodname>;</para>
342 <para><methodname>setRightEdge(float $right)</methodname>;</para>
346 <para><type>Float</type><methodname>getTopEdge()</methodname>;</para>
350 <para><methodname>setTopEdge(float $top)</methodname>;</para>
355 <sect4 id="zend.pdf.pages.interactive-features.destinations.types.fit-bounding-box">
356 <title>Zend_Pdf_Destination_FitBoundingBox</title>
359 Display the specified page, with its contents magnified just enough to fit
360 its bounding box entirely within the window both horizontally and vertically.
361 If the required horizontal and vertical magnification factors are different,
362 use the smaller of the two, centering the bounding box within the window in
367 Destination object may be created using
368 <methodname>Zend_Pdf_Destination_FitBoundingBox::create($page, $left, $bottom,
369 $right, $top)</methodname> method.
373 Where <varname>$page</varname> is a destination page
374 (a <classname>Zend_Pdf_Page</classname> object or a page number).
379 id="zend.pdf.pages.interactive-features.destinations.types.fit-bounding-box-horizontally">
380 <title>Zend_Pdf_Destination_FitBoundingBoxHorizontally</title>
383 Display the specified page, with the vertical coordinate top positioned at
384 the top edge of the window and the contents of the page magnified just enough
385 to fit the entire width of its bounding box within the window.
389 Destination object may be created using
390 <methodname>Zend_Pdf_Destination_FitBoundingBoxHorizontally::create($page,
391 $top)</methodname> method.
401 <varname>$page</varname> is a destination page
402 (a <classname>Zend_Pdf_Page</classname> object or a page number).
408 <varname>$top</varname> is a top edge of the displayed page
415 <classname>Zend_Pdf_Destination_FitBoundingBoxHorizontally</classname> class
416 also provides the following methods:
421 <para><type>Float</type><methodname>getTopEdge()</methodname>;</para>
425 <para><methodname>setTopEdge(float $top)</methodname>;</para>
431 id="zend.pdf.pages.interactive-features.destinations.types.fit-bounding-box-vertically">
432 <title>Zend_Pdf_Destination_FitBoundingBoxVertically</title>
435 Display the specified page, with the horizontal coordinate left positioned at
436 the left edge of the window and the contents of the page magnified just
437 enough to fit the entire height of its bounding box within the window.
441 Destination object may be created using
442 <methodname>Zend_Pdf_Destination_FitBoundingBoxVertically::create($page,
443 $left)</methodname> method.
453 <varname>$page</varname> is a destination page
454 (a <classname>Zend_Pdf_Page</classname> object or a page number).
460 <varname>$left</varname> is a left edge of the displayed page
467 <classname>Zend_Pdf_Destination_FitBoundingBoxVertically</classname> class
468 also provides the following methods:
473 <para><type>Float</type><methodname>getLeftEdge()</methodname>;</para>
477 <para><methodname>setLeftEdge(float $left)</methodname>;</para>
482 <sect4 id="zend.pdf.pages.interactive-features.destinations.types.named">
483 <title>Zend_Pdf_Destination_Named</title>
486 All destinations listed above are "Explicit Destinations".
490 In addition to this, <acronym>PDF</acronym> document may contain a dictionary
491 of such destinations which may be used to reference from outside the
492 <acronym>PDF</acronym> (e.g.
493 '<filename>http://www.mycompany.com/document.pdf#chapter3</filename>').
497 <classname>Zend_Pdf_Destination_Named</classname> objects allow to refer
498 destinations from the document named destinations dictionary.
502 Named destination object may be created using
503 <methodname>Zend_Pdf_Destination_Named::create(string $name)</methodname>
508 <classname>Zend_Pdf_Destination_Named</classname> class provides the only one
513 <type>String</type><methodname>getName()</methodname>;
518 <sect3 id="zend.pdf.pages.interactive-features.destinations.processing">
519 <title>Document level destination processing</title>
522 <classname>Zend_Pdf</classname> class provides a set of destinations processing
527 Each destination object (including named destinations) can be resolved using the
528 <methodname>resolveDestination($destination)</methodname> method. It returns
529 corresponding <classname>Zend_Pdf_Page</classname> object, if destination target
530 is found, or <constant>NULL</constant> otherwise.
534 <methodname>Zend_Pdf::resolveDestination()</methodname> method also takes
535 an optional boolean parameter <varname>$refreshPageCollectionHashes</varname>,
536 which is <constant>TRUE</constant> by default. It forces
537 <classname>Zend_Pdf</classname> object to refresh internal page collection hashes
538 since document pages list may be updated by user using
539 <varname>Zend_Pdf::$pages</varname> property
540 (<link linkend="zend.pdf.pages">Working with Pages</link>).
541 It may be turned off for performance reasons,
542 if it's known that document pages list wasn't changed since last method
547 Complete list of named destinations can be retrieved using
548 <methodname>Zend_Pdf::getNamedDestinations()</methodname> method. It returns
549 an array of <classname>Zend_Pdf_Target</classname> objects, which are actually
550 either an explicit destination or a GoTo action
551 (<link linkend="zend.pdf.pages.interactive-features.actions">Actions</link>).
555 <methodname>Zend_Pdf::getNamedDestination(string $name)</methodname> method returns
556 specified named destination (an explicit destination or a GoTo action).
560 <acronym>PDF</acronym> document named destinations dictionary may be updated with
561 <methodname>Zend_Pdf::setNamedDestination(string $name, $destination)</methodname>
562 method, where <varname>$destination</varname> is either an explicit destination
563 (any destination except <classname>Zend_Pdf_Destination_Named</classname>) or
568 If <constant>NULL</constant> is specified in place of
569 <varname>$destination</varname>, then specified named destination is removed.
574 Unresolvable named destinations are automatically removed from a document
575 while document saving.
579 <example id="zend.pdf.interactive-features.destinations.example-1">
580 <title>Destinations usage example</title>
582 <programlisting language="php"><![CDATA[
583 $pdf = new Zend_Pdf();
584 $page1 = $pdf->newPage(Zend_Pdf_Page::SIZE_A4);
585 $page2 = $pdf->newPage(Zend_Pdf_Page::SIZE_A4);
586 $page3 = $pdf->newPage(Zend_Pdf_Page::SIZE_A4);
587 // Page created, but not included into pages list
589 $pdf->pages[] = $page1;
590 $pdf->pages[] = $page2;
592 $destination1 = Zend_Pdf_Destination_Fit::create($page2);
593 $destination2 = Zend_Pdf_Destination_Fit::create($page3);
595 // Returns $page2 object
596 $page = $pdf->resolveDestination($destination1);
598 // Returns null, page 3 is not included into document yet
599 $page = $pdf->resolveDestination($destination2);
601 $pdf->setNamedDestination('Page2', $destination1);
602 $pdf->setNamedDestination('Page3', $destination2);
604 // Returns $destination2
605 $destination = $pdf->getNamedDestination('Page3');
607 // Returns $destination1
608 $pdf->resolveDestination(Zend_Pdf_Destination_Named::create('Page2'));
610 // Returns null, page 3 is not included into document yet
611 $pdf->resolveDestination(Zend_Pdf_Destination_Named::create('Page3'));
617 <sect2 id="zend.pdf.pages.interactive-features.actions">
618 <title>Actions</title>
621 Instead of simply jumping to a destination in the document, an annotation or
622 outline item can specify an action for the viewer application to perform,
623 such as launching an application, playing a sound, or changing an annotation's
627 <sect3 id="zend.pdf.pages.interactive-features.actions.types">
628 <title>Supported action types</title>
631 The following action types are recognized while loading <acronym>PDF</acronym>
638 <classname>Zend_Pdf_Action_GoTo</classname> - go to
639 a destination in the current document.
645 <classname>Zend_Pdf_Action_GoToR</classname> - go to
646 a destination in another document.
652 <classname>Zend_Pdf_Action_GoToE</classname> - go to
653 a destination in an embedded file.
659 <classname>Zend_Pdf_Action_Launch</classname> - launch
660 an application or open or print a document.
666 <classname>Zend_Pdf_Action_Thread</classname> - begin reading
673 <classname>Zend_Pdf_Action_URI</classname> - resolve a
674 <acronym>URI</acronym>.
680 <classname>Zend_Pdf_Action_Sound</classname> - play a sound.
686 <classname>Zend_Pdf_Action_Movie</classname> - play a movie.
692 <classname>Zend_Pdf_Action_Hide</classname> - hides or shows
693 one or more annotations on the screen.
699 <classname>Zend_Pdf_Action_Named</classname> - execute an action
700 predefined by the viewer application:
706 <emphasis>NextPage</emphasis> - Go to the next page
713 <emphasis>PrevPage</emphasis> - Go to the previous
714 page of the document.
720 <emphasis>FirstPage</emphasis> - Go to the first page
727 <emphasis>LastPage</emphasis> - Go to the last page
736 <classname>Zend_Pdf_Action_SubmitForm</classname> - send data to
737 a uniform resource locator.
743 <classname>Zend_Pdf_Action_ResetForm</classname> - set fields
744 to their default values.
750 <classname>Zend_Pdf_Action_ImportData</classname> - import field
757 <classname>Zend_Pdf_Action_JavaScript</classname> - execute
764 <classname>Zend_Pdf_Action_SetOCGState</classname> - set the state of
765 one or more optional content groups.
771 <classname>Zend_Pdf_Action_Rendition</classname> - control the
772 playing of multimedia content (begin, stop, pause, or resume
773 a playing rendition).
779 <classname>Zend_Pdf_Action_Trans</classname> - update the display
780 of a document, using a transition dictionary.
786 <classname>Zend_Pdf_Action_GoTo3DView</classname> - set
787 the current view of a 3D annotation.
793 Only <classname>Zend_Pdf_Action_GoTo</classname> and
794 <classname>Zend_Pdf_Action_URI</classname> actions can be created by
799 GoTo action object can be created using
800 <methodname>Zend_Pdf_Action_GoTo::create($destination)</methodname> method,
801 where <varname>$destination</varname> is a
802 <classname>Zend_Pdf_Destination</classname> object or a string which can be used
803 to identify named destination.
807 <methodname>Zend_Pdf_Action_URI::create($uri[, $isMap])</methodname> method has
808 to be used to create a URI action (see <acronym>API</acronym> documentation for the
809 details). Optional <varname>$isMap</varname> parameter is set to
810 <constant>FALSE</constant> by default.
814 It also supports the following methods:
818 <sect3 id="zend.pdf.pages.interactive-features.actions.chaining">
819 <title>Actions chaining</title>
822 Actions objects can be chained using <varname>Zend_Pdf_Action::$next</varname>
827 It's an array of <classname>Zend_Pdf_Action</classname> objects, which also
828 may have their sub-actions.
832 <classname>Zend_Pdf_Action</classname> class supports RecursiveIterator interface,
833 so child actions may be iterated recursively:
836 <programlisting language="php"><![CDATA[
837 $pdf = new Zend_Pdf();
838 $page1 = $pdf->newPage(Zend_Pdf_Page::SIZE_A4);
839 $page2 = $pdf->newPage(Zend_Pdf_Page::SIZE_A4);
840 // Page created, but not included into pages list
841 $page3 = $pdf->newPage(Zend_Pdf_Page::SIZE_A4);
843 $pdf->pages[] = $page1;
844 $pdf->pages[] = $page2;
846 $action1 = Zend_Pdf_Action_GoTo::create(
847 Zend_Pdf_Destination_Fit::create($page2));
848 $action2 = Zend_Pdf_Action_GoTo::create(
849 Zend_Pdf_Destination_Fit::create($page3));
850 $action3 = Zend_Pdf_Action_GoTo::create(
851 Zend_Pdf_Destination_Named::create('Chapter1'));
852 $action4 = Zend_Pdf_Action_GoTo::create(
853 Zend_Pdf_Destination_Named::create('Chapter5'));
855 $action2->next[] = $action3;
856 $action2->next[] = $action4;
858 $action1->next[] = $action2;
860 $actionsCount = 1; // Note! Iteration doesn't include top level action and
861 // walks through children only
862 $iterator = new RecursiveIteratorIterator(
864 RecursiveIteratorIterator::SELF_FIRST);
865 foreach ($iterator as $chainedAction) {
869 // Prints 'Actions in a tree: 4'
870 printf("Actions in a tree: %d\n", $actionsCount++);
874 <sect3 id="zend.pdf.pages.interactive-features.actions.open-action">
875 <title>Document Open Action</title>
878 Special open action may be specify a destination to be displayed or an action
879 to be performed when the document is opened.
883 <methodname>Zend_Pdf_Target Zend_Pdf::getOpenAction()</methodname> method
884 returns current document open action (or <constant>NULL</constant> if open action
889 <methodname>setOpenAction(Zend_Pdf_Target $openAction = null)</methodname>
890 method sets document open action or clean it if <varname>$openAction</varname>
891 is <constant>NULL</constant>.
896 <sect2 id="zend.pdf.pages.interactive-features.outlines">
897 <title>Document Outline (bookmarks)</title>
900 A PDF document may optionally display a document outline on the screen, allowing
901 the user to navigate interactively from one part of the document to another.
902 The outline consists of a tree-structured hierarchy of outline items (sometimes
903 called bookmarks), which serve as a visual table of contents to display the document's
904 structure to the user. The user can interactively open and close individual
905 items by clicking them with the mouse. When an item is open, its immediate children
906 in the hierarchy become visible on the screen; each child may in turn be
907 open or closed, selectively revealing or hiding further parts of the hierarchy.
908 When an item is closed, all of its descendants in the hierarchy are hidden. Clicking
909 the text of any visible item activates the item, causing the viewer application to
910 jump to a destination or trigger an action associated with the item.
914 <classname>Zend_Pdf</classname> class provides public property
915 <varname>$outlines</varname> which is an array of
916 <classname>Zend_Pdf_Outline</classname> objects.
918 <programlisting language="php"><![CDATA[
919 $pdf = Zend_Pdf::load($path);
921 // Remove outline item
922 unset($pdf->outlines[0]->childOutlines[1]);
924 // Set Outline to be displayed in bold
925 $pdf->outlines[0]->childOutlines[3]->setIsBold(true);
928 $pdf->outlines[0]->childOutlines[5]->childOutlines[] =
929 Zend_Pdf_Outline::create('Chapter 2', 'chapter_2');
931 $pdf->save($path, true);
936 Outline attributes may be retrieved or set using the following methods:
942 <methodname>string getTitle()</methodname> - get outline item title.
948 <methodname>setTitle(string $title)</methodname> - set outline item title.
954 <methodname>boolean isOpen()</methodname> - <constant>TRUE</constant> if outline
961 <methodname>setIsOpen(boolean $isOpen)</methodname> - set isOpen state.
967 <methodname>boolean isItalic()</methodname> - <constant>TRUE</constant> if
968 outline item is displayed in italic.
974 <methodname>setIsItalic(boolean $isItalic)</methodname> - set
981 <methodname>boolean isBold()</methodname> - <constant>TRUE</constant> if outline
982 item is displayed in bold.
988 <methodname>setIsBold(boolean $isBold)</methodname> - set
995 <methodname>Zend_Pdf_Color_Rgb getColor()</methodname> - get outline
996 text color (<constant>NULL</constant> means black).
1002 <methodname>setColor(Zend_Pdf_Color_Rgb $color)</methodname> - set
1003 outline text color (<constant>NULL</constant> means black).
1009 <methodname>Zend_Pdf_Target getTarget()</methodname> - get outline
1010 target (action or explicit or named destination object).
1016 <methodname>setTarget(Zend_Pdf_Target|string $target)</methodname> - set
1017 outline target (action or destination). String may be used to identify
1018 named destination. <constant>NULL</constant> means 'no target'.
1024 <methodname>array getOptions()</methodname> - get outline attributes
1031 <methodname>setOptions(array $options)</methodname> - set outline options.
1032 The following options are recognized: 'title', 'open', 'color', 'italic',
1033 'bold', and 'target'.
1039 New outline may be created in two ways:
1045 <methodname>Zend_Pdf_Outline::create(string $title[, Zend_Pdf_Target|string
1046 $target])</methodname>
1052 <methodname>Zend_Pdf_Outline::create(array $options)</methodname>
1058 Each outline object may have child outline items listed in
1059 <varname>Zend_Pdf_Outline::$childOutlines</varname> public property.
1060 It's an array of <classname>Zend_Pdf_Outline</classname> objects,
1061 so outlines are organized in a tree.
1065 <classname>Zend_Pdf_Outline</classname> class implements RecursiveArray interface,
1066 so child outlines may be recursively iterated using RecursiveIteratorIterator:
1069 <programlisting language="php"><![CDATA[
1070 $pdf = Zend_Pdf::load($path);
1072 foreach ($pdf->outlines as $documentRootOutlineEntry) {
1073 $iterator = new RecursiveIteratorIterator(
1074 $documentRootOutlineEntry,
1075 RecursiveIteratorIterator::SELF_FIRST
1077 foreach ($iterator as $childOutlineItem) {
1078 $OutlineItemTarget = $childOutlineItem->getTarget();
1079 if ($OutlineItemTarget instanceof Zend_Pdf_Destination) {
1080 if ($pdf->resolveDestination($OutlineItemTarget) === null) {
1081 // Mark Outline item with unresolvable destination
1083 $childOutlineItem->setColor(new Zend_Pdf_Color_Rgb(1, 0, 0));
1085 } else if ($OutlineItemTarget instanceof Zend_Pdf_Action_GoTo) {
1086 $OutlineItemTarget->setDestination();
1087 if ($pdf->resolveDestination($OutlineItemTarget) === null) {
1088 // Mark Outline item with unresolvable destination
1090 $childOutlineItem->setColor(new Zend_Pdf_Color_Rgb(1, 0, 0));
1096 $pdf->save($path, true);
1097 ]]></programlisting>
1101 All outline items with unresolved destinations (or destinations of GoTo
1102 actions) are updated while document saving by setting their targets to
1103 <constant>NULL</constant>. So document will not be corrupted by removing pages
1104 referenced by outlines.
1109 <sect2 id="zend.pdf.pages.interactive-features.annotations">
1110 <title>Annotations</title>
1113 An annotation associates an object such as a note, sound, or movie with a location
1114 on a page of a PDF document, or provides a way to interact with the user by means
1115 of the mouse and keyboard.
1119 All annotations are represented by <classname>Zend_Pdf_Annotation</classname>
1124 Annotation may be attached to a page using
1125 <methodname>Zend_Pdf_Page::attachAnnotation(Zend_Pdf_Annotation
1126 $annotation)</methodname> method.
1130 Three types of annotations may be created by user now:
1136 <methodname>Zend_Pdf_Annotation_Link::create($x1, $y1, $x2, $y2,
1137 $target)</methodname> where <varname>$target</varname> is an action object
1138 or a destination or string (which may be used in place of named destination
1145 <methodname>Zend_Pdf_Annotation_Text::create($x1, $y1, $x2, $y2,
1152 <methodname>Zend_Pdf_Annotation_FileAttachment::create($x1, $y1, $x2, $y2,
1153 $fileSpecification)</methodname>
1159 A link annotation represents either a hypertext link to a destination elsewhere in
1160 the document or an action to be performed.
1164 A text annotation represents a "sticky note" attached to a point in the PDF document.
1168 A file attachment annotation contains a reference to a file.
1172 The following methods are shared between all annotation types:
1177 <para><methodname>setLeft(float $left)</methodname></para>
1181 <para><methodname>float getLeft()</methodname></para>
1185 <para><methodname>setRight(float $right)</methodname></para>
1189 <para><methodname>float getRight()</methodname></para>
1193 <para><methodname>setTop(float $top)</methodname></para>
1197 <para><methodname>float getTop()</methodname></para>
1201 <para><methodname>setBottom(float $bottom)</methodname></para>
1205 <para><methodname>float getBottom()</methodname></para>
1209 <para><methodname>setText(string $text)</methodname></para>
1213 <para><methodname>string getText()</methodname></para>
1218 Text annotation property is a text to be displayed for the annotation or, if this
1219 type of annotation does not display text, an alternate description of the annotation's
1220 contents in human-readable form.
1224 Link annotation objects also provide two additional methods:
1230 <methodname>setDestination(Zend_Pdf_Target|string $target)</methodname>
1236 <methodname>Zend_Pdf_Target getDestination()</methodname>
1243 vim:se ts=4 sw=4 et: