1PDF::API2::Annotation(3U)ser Contributed Perl DocumentatiPoDnF::API2::Annotation(3)
2
3
4
6 PDF::API2::Annotation - Add annotations to a PDF
7
9 $annotation = PDF::API2::Annotation->new()
10 Returns an annotation object (called from $page->annotation()).
11
12 $annotation->link($page, %options)
13 Link the annotation to another page in this PDF.
14
15 Accepts options -rect, -border, and any of the options listed under
16 dest().
17
18 $annotation->url($url, %options)
19 Launch $url when the annotation is selected.
20
21 Accepts options -rect and -border.
22
23 $annotation->file($filename, %options)
24 Open $filename when the annotation is selected.
25
26 Accepts options -rect and -border.
27
28 $annotation->pdf_file($filename, $page_number, %options)
29 Open the PDF file located at $filename to the specified page
30 number.
31
32 Accepts options -rect, -border, and any of the options listed under
33 dest().
34
35 $annotation->text($text, %options)
36 Define the annotation as a text note with the specified content.
37
38 Accepts options -rect and -open.
39
40 $annotation->movie($filename, $content_type, %options)
41 Embed and link to the movie located at $filename with the specified
42 MIME type.
43
44 Accepts a -rect option.
45
46 $annotation->rect($llx, $lly, $urx, $ury)
47 Define the rectangle around the annotation.
48
49 $annotation->border($horizontal_corner_radius, $vertical_corner_radius,
50 $width)
51 Define the border style. Defaults to 0, 0, 1.
52
53 $annotation->content(@lines)
54 Define the text content of the annotation, if applicable.
55
56 $annotation->open($boolean)
57 Display the annotation either open or closed, if applicable.
58
59 $annotation->dest( $page, -fit => 1 )
60 Display the page designated by page, with its contents magnified
61 just enough to fit the entire page within the window both
62 horizontally and vertically. If the required horizontal and
63 vertical magnification factors are different, use the smaller of
64 the two, centering the page within the window in the other
65 dimension.
66
67 $annotation->dest( $page, -fith => $top )
68 Display the page designated by page, with the vertical coordinate
69 top positioned at the top edge of the window and the contents of
70 the page magnified just enough to fit the entire width of the page
71 within the window.
72
73 $annotation->dest( $page, -fitv => $left )
74 Display the page designated by page, with the horizontal coordinate
75 left positioned at the left edge of the window and the contents of
76 the page magnified just enough to fit the entire height of the page
77 within the window.
78
79 $annotation->dest( $page, -fitr => [ $left, $bottom, $right, $top ] )
80 Display the page designated by page, with its contents magnified
81 just enough to fit the rectangle specified by the coordinates left,
82 bottom, right, and top entirely within the window both horizontally
83 and vertically. If the required horizontal and vertical
84 magnification factors are different, use the smaller of the two,
85 centering the rectangle within the window in the other dimension.
86
87 $annotation->dest( $page, -fitb => 1 )
88 (PDF 1.1) Display the page designated by page, with its contents
89 magnified just enough to fit its bounding box entirely within the
90 window both horizontally and vertically. If the required horizontal
91 and vertical magnification factors are different, use the smaller
92 of the two, centering the bounding box within the window in the
93 other dimension.
94
95 $annotation->dest( $page, -fitbh => $top )
96 (PDF 1.1) Display the page designated by page, with the vertical
97 coordinate top positioned at the top edge of the window and the
98 contents of the page magnified just enough to fit the entire width
99 of its bounding box within the window.
100
101 $annotation->dest( $page, -fitbv => $left )
102 (PDF 1.1) Display the page designated by page, with the horizontal
103 coordinate left positioned at the left edge of the window and the
104 contents of the page magnified just enough to fit the entire height
105 of its bounding box within the window.
106
107 $annotation->dest( $page, -xyz => [ $left, $top, $zoom ] )
108 Display the page designated by page, with the coordinates (left,
109 top) positioned at the top-left corner of the window and the
110 contents of the page magnified by the factor zoom. A zero (0) value
111 for any of the parameters left, top, or zoom specifies that the
112 current value of that parameter is to be retained unchanged.
113
114 $annotation->dest( $name )
115 (PDF 1.2) Connect the Annotation to a "Named Destination" defined
116 elsewhere.
117
118
119
120perl v5.30.1 2020-02-06 PDF::API2::Annotation(3)