1PDF::Builder::Outline(3U)ser Contributed Perl DocumentatiPoDnF::Builder::Outline(3)
2
3
4
6 PDF::Builder::Outline - Manage PDF outlines (a.k.a. bookmarks)
7
9 # Get/create the top-level outline tree
10 my $outlines = $pdf->outline();
11
12 # Add an entry
13 my $item = $outlines->outline();
14 $item->title('First Page');
15 $item->dest($pdf->open_page(1), fit-def);
16
18 $outline = PDF::Builder::Outline->new($api, $parent, $prev)
19 Returns a new outline object (called from $outlines->outline()).
20
21 Examine the Outline Tree
22 $boolean = $outline->has_children()
23 Return true if the current outline item has children (child items).
24
25 $integer = $outline->count()
26 Return the number of descendants that are visible when the current
27 outline item is open (expanded).
28
29 $child = $outline->first()
30 Return the first child of the current outline level, if one exists.
31
32 $child = $outline->last()
33 Return the last child of the current outline level, if one exists.
34
35 $parent = $outline->parent()
36 Return the parent of the current item, if not at the top level of
37 the outline tree.
38
39 $sibling = $outline->prev()
40 Return the previous item of the current level of the outline tree.
41
42 $sibling = $outline->next()
43 Return the next item of the current level of the outline tree.
44
45 Modify the Outline Tree
46 $child_outline = $parent_outline->outline()
47 Returns a new sub-outline (nested outline) added at the end of the
48 current outline's children.
49
50 $sibling = $outline->insert_after()
51 Add an outline item immediately following the current item.
52
53 $sibling = $outline->insert_before()
54 Add an outline item immediately preceding the current item.
55
56 $outline->delete()
57 Remove the current outline item from the outline tree. If the item
58 has any children, they will effectively be deleted as well, since
59 they will no longer be linked.
60
61 $boolean = $outline->is_open() # Get
62 $outline = $outline->is_open($boolean) # Set
63 Get/set whether the outline is expanded (open) or collapsed
64 (closed).
65
66 $outline->open()
67 Set the status of the outline to open (i.e., expanded).
68
69 This is an alternate method to using is_open(true).
70
71 $outline->closed()
72 Set the status of the outline to closed (i.e., collapsed).
73
74 This is an alternate method to using is_open(false).
75
76 Set Outline Attributes
77 $title = $outline->title() # Get
78 $outline = $outline->title($text) # Set
79 Get/set the title of the outline item.
80
81 $outline->dest($page_object, %position)
82 $outline->dest($page_object)
83 Sets the destination page and optional position of the outline.
84
85 %position can be any of those listed in "Page Fit Options" in
86 PDF::Builder::Docs.
87
88 "xyz" is the default fit setting, with position (left and top) and
89 zoom the same as the calling page's.
90
91 $outline->dest($name, %position)
92 $outline->dest($name)
93 Connect the Outline to a "Named Destination" defined elsewhere, and
94 optional positioning as described above.
95
96 Destination targets
97 $outline->uri($url)
98 Defines the outline as launch-url with url $url, typically a web
99 page.
100
101 Alternate name: "url"
102
103 Either "uri" or "url" may be used; "uri" is for compatibility with
104 PDF::API2.
105
106 $outline->launch($file)
107 Defines the outline as launch-file with filepath $file. This is
108 typically a local application or file.
109
110 Alternate name: "file"
111
112 Either "launch" or "file" may be used; "launch" is for
113 compatibility with PDF::API2.
114
115 $outline->pdf($pdffile, $page_number, %position, %args)
116 $outline->pdf($pdffile, $page_number)
117 Defines the destination of the outline as a PDF-file with filepath
118 $pdffile, on page $pagenum (default 0), and position %position
119 (same as dest()).
120
121 Alternate names: "pdf_file" and "pdfile"
122
123 Either "pdf" or "pdf_file" (or the older "pdfile") may be used;
124 "pdf" is for compatibility with PDF::API2.
125
126
127
128perl v5.38.0 2023-07-21 PDF::Builder::Outline(3)