1PDF::API2::Outline(3) User Contributed Perl DocumentationPDF::API2::Outline(3)
2
3
4
6 PDF::API2::Outline - Manage PDF outlines (a.k.a. bookmarks)
7
9 # Get/create the top-level outline tree
10 my $outline = $pdf->outline();
11
12 # Add an entry
13 my $item = $outline->outline();
14 $item->title('First Page');
15 $item->destination($pdf->open_page(1));
16
18 Examine the Outline Tree
19 has_children
20
21 my $boolean = $outline->has_children();
22
23 Return true if the current outline item has child items.
24
25 count
26
27 my $integer = $outline->count();
28
29 Return the number of descendants that are visible when the current
30 outline item is open (expanded).
31
32 first
33
34 my $child = $outline->first();
35
36 Return the first child of the current outline level, if one exists.
37
38 last
39
40 my $child = $outline->last();
41
42 Return the last child of the current outline level, if one exists.
43
44 parent
45
46 my $parent = $outline->parent();
47
48 Return the parent of the current item, if not at the top level of the
49 outline tree.
50
51 prev
52
53 my $sibling = $outline->prev();
54
55 Return the previous item of the current level of the outline tree.
56
57 next
58
59 my $sibling = $outline->next();
60
61 Return the next item of the current level of the outline tree.
62
63 Modify the Outline Tree
64 outline
65
66 my $child = $outline->outline();
67
68 Add an outline item at the end of the current outline's list of
69 children.
70
71 insert_after
72
73 my $sibling = $outline->insert_after();
74
75 Add an outline item immediately following the current item.
76
77 insert_before
78
79 $sibling = $outline->insert_before();
80
81 Add an outline item immediately preceding the current item.
82
83 delete
84
85 $outline->delete();
86
87 Remove the current outline item from the outline tree. If the item has
88 any children, they will effectively be deleted as well since they will
89 no longer be linked.
90
91 is_open
92
93 # Get
94 my $boolean = $outline->is_open();
95
96 # Set
97 my $outline = $outline->is_open($boolean);
98
99 Get/set whether the outline is expanded or collapsed.
100
101 Set Outline Attributes
102 title
103
104 # Get
105 my $title = $outline->title();
106
107 # Set
108 $outline = $outline->title($text);
109
110 Get/set the title of the outline item.
111
112 destination
113
114 $outline = $outline->destination($destination, $location, @args);
115
116 Set the destination page and optional position of the outline.
117 $location and @args are as defined in "destination" in
118 PDF::API2::NamedDestination.
119
120 $destination can optionally be the name of a named destination defined
121 elsewhere.
122
123 uri
124
125 $outline = $outline->uri($uri);
126
127 Launch a URI -- typically a web page -- when the outline item is
128 activated.
129
130 launch
131
132 $outline->launch($file);
133
134 Launch an application or file when the outline item is activated.
135
136 pdf
137
138 $outline = $outline->pdf($filename, $page_number, $location, @args);
139
140 Open another PDF file to a particular page number (first page is zero,
141 which is also the default). The page can optionally be positioned at a
142 particular location if $location and @args are set -- see "destination"
143 in PDF::API2::NamedDestination for possible settings.
144
145
146
147perl v5.38.0 2023-07-21 PDF::API2::Outline(3)