.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "PDF::API2::Outline 3pm" .TH PDF::API2::Outline 3pm "2023-09-29" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" PDF::API2::Outline \- Manage PDF outlines (a.k.a. bookmarks) .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& # Get/create the top\-level outline tree \& my $outline = $pdf\->outline(); \& \& # Add an entry \& my $item = $outline\->outline(); \& $item\->title(\*(AqFirst Page\*(Aq); \& $item\->destination($pdf\->open_page(1)); .Ve .SH "METHODS" .IX Header "METHODS" .SS "Examine the Outline Tree" .IX Subsection "Examine the Outline Tree" \fIhas_children\fR .IX Subsection "has_children" .PP .Vb 1 \& my $boolean = $outline\->has_children(); .Ve .PP Return true if the current outline item has child items. .PP \fIcount\fR .IX Subsection "count" .PP .Vb 1 \& my $integer = $outline\->count(); .Ve .PP Return the number of descendants that are visible when the current outline item is open (expanded). .PP \fIfirst\fR .IX Subsection "first" .PP .Vb 1 \& my $child = $outline\->first(); .Ve .PP Return the first child of the current outline level, if one exists. .PP \fIlast\fR .IX Subsection "last" .PP .Vb 1 \& my $child = $outline\->last(); .Ve .PP Return the last child of the current outline level, if one exists. .PP \fIparent\fR .IX Subsection "parent" .PP .Vb 1 \& my $parent = $outline\->parent(); .Ve .PP Return the parent of the current item, if not at the top level of the outline tree. .PP \fIprev\fR .IX Subsection "prev" .PP .Vb 1 \& my $sibling = $outline\->prev(); .Ve .PP Return the previous item of the current level of the outline tree. .PP \fInext\fR .IX Subsection "next" .PP .Vb 1 \& my $sibling = $outline\->next(); .Ve .PP Return the next item of the current level of the outline tree. .SS "Modify the Outline Tree" .IX Subsection "Modify the Outline Tree" \fIoutline\fR .IX Subsection "outline" .PP .Vb 1 \& my $child = $outline\->outline(); .Ve .PP Add an outline item at the end of the current outline's list of children. .PP \fIinsert_after\fR .IX Subsection "insert_after" .PP .Vb 1 \& my $sibling = $outline\->insert_after(); .Ve .PP Add an outline item immediately following the current item. .PP \fIinsert_before\fR .IX Subsection "insert_before" .PP .Vb 1 \& $sibling = $outline\->insert_before(); .Ve .PP Add an outline item immediately preceding the current item. .PP \fIdelete\fR .IX Subsection "delete" .PP .Vb 1 \& $outline\->delete(); .Ve .PP Remove the current outline item from the outline tree. If the item has any children, they will effectively be deleted as well since they will no longer be linked. .PP \fIis_open\fR .IX Subsection "is_open" .PP .Vb 2 \& # Get \& my $boolean = $outline\->is_open(); \& \& # Set \& my $outline = $outline\->is_open($boolean); .Ve .PP Get/set whether the outline is expanded or collapsed. .SS "Set Outline Attributes" .IX Subsection "Set Outline Attributes" \fItitle\fR .IX Subsection "title" .PP .Vb 2 \& # Get \& my $title = $outline\->title(); \& \& # Set \& $outline = $outline\->title($text); .Ve .PP Get/set the title of the outline item. .PP \fIdestination\fR .IX Subsection "destination" .PP .Vb 1 \& $outline = $outline\->destination($destination, $location, @args); .Ve .PP Set the destination page and optional position of the outline. \f(CW$location\fR and \&\f(CW@args\fR are as defined in \*(L"destination\*(R" in PDF::API2::NamedDestination. .PP \&\f(CW$destination\fR can optionally be the name of a named destination defined elsewhere. .PP \fIuri\fR .IX Subsection "uri" .PP .Vb 1 \& $outline = $outline\->uri($uri); .Ve .PP Launch a \s-1URI\s0 \*(-- typically a web page \*(-- when the outline item is activated. .PP \fIlaunch\fR .IX Subsection "launch" .PP .Vb 1 \& $outline\->launch($file); .Ve .PP Launch an application or file when the outline item is activated. .PP \fIpdf\fR .IX Subsection "pdf" .PP .Vb 1 \& $outline = $outline\->pdf($filename, $page_number, $location, @args); .Ve .PP Open another \s-1PDF\s0 file to a particular page number (first page is zero, which is also the default). The page can optionally be positioned at a particular location if \f(CW$location\fR and \f(CW@args\fR are set \*(-- see \&\*(L"destination\*(R" in PDF::API2::NamedDestination for possible settings.