.\" 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::Builder::Outline 3pm" .TH PDF::Builder::Outline 3pm "2023-01-24" "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::Builder::Outline \- Manage PDF outlines (a.k.a. bookmarks) .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& # Get/create the top\-level outline tree \& my $outlines = $pdf\->outline(); \& \& # Add an entry \& my $item = $outlines\->outline(); \& $item\->title(\*(AqFirst Page\*(Aq); \& $item\->dest($pdf\->open_page(1), fit\-def); .Ve .SH "METHODS" .IX Header "METHODS" .ie n .IP "$outline = PDF::Builder::Outline\->new($api, $parent, $prev)" 4 .el .IP "\f(CW$outline\fR = PDF::Builder::Outline\->new($api, \f(CW$parent\fR, \f(CW$prev\fR)" 4 .IX Item "$outline = PDF::Builder::Outline->new($api, $parent, $prev)" Returns a new outline object (called from \f(CW$outlines\fR\->\fBoutline()\fR). .SS "Examine the Outline Tree" .IX Subsection "Examine the Outline Tree" .ie n .IP "$boolean = $outline\->\fBhas_children()\fR" 4 .el .IP "\f(CW$boolean\fR = \f(CW$outline\fR\->\fBhas_children()\fR" 4 .IX Item "$boolean = $outline->has_children()" Return true if the current outline item has children (child items). .ie n .IP "$integer = $outline\->\fBcount()\fR" 4 .el .IP "\f(CW$integer\fR = \f(CW$outline\fR\->\fBcount()\fR" 4 .IX Item "$integer = $outline->count()" Return the number of descendants that are visible when the current outline item is open (expanded). .ie n .IP "$child = $outline\->\fBfirst()\fR" 4 .el .IP "\f(CW$child\fR = \f(CW$outline\fR\->\fBfirst()\fR" 4 .IX Item "$child = $outline->first()" Return the first child of the current outline level, if one exists. .ie n .IP "$child = $outline\->\fBlast()\fR" 4 .el .IP "\f(CW$child\fR = \f(CW$outline\fR\->\fBlast()\fR" 4 .IX Item "$child = $outline->last()" Return the last child of the current outline level, if one exists. .ie n .IP "$parent = $outline\->\fBparent()\fR" 4 .el .IP "\f(CW$parent\fR = \f(CW$outline\fR\->\fBparent()\fR" 4 .IX Item "$parent = $outline->parent()" Return the parent of the current item, if not at the top level of the outline tree. .ie n .IP "$sibling = $outline\->\fBprev()\fR" 4 .el .IP "\f(CW$sibling\fR = \f(CW$outline\fR\->\fBprev()\fR" 4 .IX Item "$sibling = $outline->prev()" Return the previous item of the current level of the outline tree. .ie n .IP "$sibling = $outline\->\fBnext()\fR" 4 .el .IP "\f(CW$sibling\fR = \f(CW$outline\fR\->\fBnext()\fR" 4 .IX Item "$sibling = $outline->next()" Return the next item of the current level of the outline tree. .SS "Modify the Outline Tree" .IX Subsection "Modify the Outline Tree" .ie n .IP "$child_outline = $parent_outline\->\fBoutline()\fR" 4 .el .IP "\f(CW$child_outline\fR = \f(CW$parent_outline\fR\->\fBoutline()\fR" 4 .IX Item "$child_outline = $parent_outline->outline()" Returns a new sub-outline (nested outline) added at the end of the current outline's children. .ie n .IP "$sibling = $outline\->\fBinsert_after()\fR" 4 .el .IP "\f(CW$sibling\fR = \f(CW$outline\fR\->\fBinsert_after()\fR" 4 .IX Item "$sibling = $outline->insert_after()" Add an outline item immediately following the current item. .ie n .IP "$sibling = $outline\->\fBinsert_before()\fR" 4 .el .IP "\f(CW$sibling\fR = \f(CW$outline\fR\->\fBinsert_before()\fR" 4 .IX Item "$sibling = $outline->insert_before()" Add an outline item immediately preceding the current item. .ie n .IP "$outline\->\fBdelete()\fR" 4 .el .IP "\f(CW$outline\fR\->\fBdelete()\fR" 4 .IX Item "$outline->delete()" 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. .ie n .IP "$boolean = $outline\->\fBis_open()\fR # Get" 4 .el .IP "\f(CW$boolean\fR = \f(CW$outline\fR\->\fBis_open()\fR # Get" 4 .IX Item "$boolean = $outline->is_open() # Get" .PD 0 .ie n .IP "$outline = $outline\->is_open($boolean) # Set" 4 .el .IP "\f(CW$outline\fR = \f(CW$outline\fR\->is_open($boolean) # Set" 4 .IX Item "$outline = $outline->is_open($boolean) # Set" .PD Get/set whether the outline is expanded (open) or collapsed (closed). .ie n .IP "$outline\->\fBopen()\fR" 4 .el .IP "\f(CW$outline\fR\->\fBopen()\fR" 4 .IX Item "$outline->open()" Set the status of the outline to open (i.e., expanded). .Sp This is an \fBalternate\fR method to using is_open(true). .ie n .IP "$outline\->\fBclosed()\fR" 4 .el .IP "\f(CW$outline\fR\->\fBclosed()\fR" 4 .IX Item "$outline->closed()" Set the status of the outline to closed (i.e., collapsed). .Sp This is an \fBalternate\fR method to using is_open(false). .SS "Set Outline Attributes" .IX Subsection "Set Outline Attributes" .ie n .IP "$title = $outline\->\fBtitle()\fR # Get" 4 .el .IP "\f(CW$title\fR = \f(CW$outline\fR\->\fBtitle()\fR # Get" 4 .IX Item "$title = $outline->title() # Get" .PD 0 .ie n .IP "$outline = $outline\->title($text) # Set" 4 .el .IP "\f(CW$outline\fR = \f(CW$outline\fR\->title($text) # Set" 4 .IX Item "$outline = $outline->title($text) # Set" .PD Get/set the title of the outline item. .ie n .IP "$outline\->dest($page_object, %position)" 4 .el .IP "\f(CW$outline\fR\->dest($page_object, \f(CW%position\fR)" 4 .IX Item "$outline->dest($page_object, %position)" .PD 0 .ie n .IP "$outline\->dest($page_object)" 4 .el .IP "\f(CW$outline\fR\->dest($page_object)" 4 .IX Item "$outline->dest($page_object)" .PD Sets the destination page and optional position of the outline. .Sp \&\f(CW%position\fR can be any of those listed in \*(L"Page Fit Options\*(R" in PDF::Builder::Docs. .Sp \&\*(L"xyz\*(R" is the \fBdefault\fR fit setting, with position (left and top) and zoom the same as the calling page's. .ie n .IP "$outline\->dest($name, %position)" 4 .el .IP "\f(CW$outline\fR\->dest($name, \f(CW%position\fR)" 4 .IX Item "$outline->dest($name, %position)" .PD 0 .ie n .IP "$outline\->dest($name)" 4 .el .IP "\f(CW$outline\fR\->dest($name)" 4 .IX Item "$outline->dest($name)" .PD Connect the Outline to a \*(L"Named Destination\*(R" defined elsewhere, and optional positioning as described above. .SS "Destination targets" .IX Subsection "Destination targets" .ie n .IP "$outline\->uri($url)" 4 .el .IP "\f(CW$outline\fR\->uri($url)" 4 .IX Item "$outline->uri($url)" Defines the outline as launch-url with url \f(CW$url\fR, typically a web page. .Sp \&\fBAlternate name:\fR \f(CW\*(C`url\*(C'\fR .Sp Either \f(CW\*(C`uri\*(C'\fR or \f(CW\*(C`url\*(C'\fR may be used; \f(CW\*(C`uri\*(C'\fR is for compatibility with \s-1PDF::API2.\s0 .ie n .IP "$outline\->launch($file)" 4 .el .IP "\f(CW$outline\fR\->launch($file)" 4 .IX Item "$outline->launch($file)" Defines the outline as launch-file with filepath \f(CW$file\fR. This is typically a local application or file. .Sp \&\fBAlternate name:\fR \f(CW\*(C`file\*(C'\fR .Sp Either \f(CW\*(C`launch\*(C'\fR or \f(CW\*(C`file\*(C'\fR may be used; \f(CW\*(C`launch\*(C'\fR is for compatibility with \s-1PDF::API2.\s0 .ie n .IP "$outline\->pdf($pdffile, $page_number, %position, %args)" 4 .el .IP "\f(CW$outline\fR\->pdf($pdffile, \f(CW$page_number\fR, \f(CW%position\fR, \f(CW%args\fR)" 4 .IX Item "$outline->pdf($pdffile, $page_number, %position, %args)" .PD 0 .ie n .IP "$outline\->pdf($pdffile, $page_number)" 4 .el .IP "\f(CW$outline\fR\->pdf($pdffile, \f(CW$page_number\fR)" 4 .IX Item "$outline->pdf($pdffile, $page_number)" .PD Defines the destination of the outline as a PDF-file with filepath \&\f(CW$pdffile\fR, on page \f(CW$pagenum\fR (default 0), and position \f(CW%position\fR (same as \fBdest()\fR). .Sp \&\fBAlternate names:\fR \f(CW\*(C`pdf_file\*(C'\fR and \f(CW\*(C`pdfile\*(C'\fR .Sp Either \f(CW\*(C`pdf\*(C'\fR or \f(CW\*(C`pdf_file\*(C'\fR (or the older \f(CW\*(C`pdfile\*(C'\fR) may be used; \f(CW\*(C`pdf\*(C'\fR is for compatibility with \s-1PDF::API2.\s0