.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" 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 "Text::PDF::Pages 3pm" .TH Text::PDF::Pages 3pm "2021-01-02" "perl v5.32.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" Text::PDF::Pages \- a PDF pages hierarchical element. Inherits from Text::PDF::Dict .SH "DESCRIPTION" .IX Header "DESCRIPTION" A Pages object is the parent to other pages objects or to page objects themselves. .SH "METHODS" .IX Header "METHODS" .SS "Text::PDF::Pages\->new($pdfs,$parent)" .IX Subsection "Text::PDF::Pages->new($pdfs,$parent)" This creates a new Pages object. Notice that \f(CW$parent\fR here is not the file context for the object but the parent pages object for this pages. If we are using this class to create a root node, then \f(CW$parent\fR should point to the file context, which is identified by not having a Type of Pages. \f(CW$pdfs\fR is the file object (or objects) in which to create the new Pages object. .ie n .SS "$p\->out_obj($isnew)" .el .SS "\f(CW$p\fP\->out_obj($isnew)" .IX Subsection "$p->out_obj($isnew)" Tells all the files that this thing is destined for that they should output this object come time to output. If this object has no parent, then it must be the root. So set as the root for the files in question and tell it to be output too. If \f(CW$isnew\fR is set, then call new_obj rather than out_obj to create as a new object in the file. .ie n .SS "$p\->find_page($pnum)" .el .SS "\f(CW$p\fP\->find_page($pnum)" .IX Subsection "$p->find_page($pnum)" Returns the given page, using the page count values in the pages tree. Pages start at 0. .ie n .SS "$p\->add_page($page, $pnum)" .el .SS "\f(CW$p\fP\->add_page($page, \f(CW$pnum\fP)" .IX Subsection "$p->add_page($page, $pnum)" Inserts the page before the given \f(CW$pnum\fR. \f(CW$pnum\fR can be \-ve to count from the \s-1END\s0 of the document. \-1 is after the last page. Likewise \f(CW$pnum\fR can be greater than the number of pages currently in the document, to append. .PP This method only guarantees to provide a reasonable pages tree if pages are appended or prepended to the document. Pages inserted in the middle of the document may simply be inserted in the appropriate leaf in the pages tree without adding any new branches or leaves. To tidy up such a mess, it is best to call \&\f(CW$p\fR\->rebuild_tree to rebuild the pages tree into something efficient. .ie n .SS "$root_pages = $p\->rebuild_tree([@pglist])" .el .SS "\f(CW$root_pages\fP = \f(CW$p\fP\->rebuild_tree([@pglist])" .IX Subsection "$root_pages = $p->rebuild_tree([@pglist])" Rebuilds the pages tree to make a nice balanced tree that conforms to Adobe recommendations. If passed a pglist then the tree is built for that list of pages. No check is made of whether the pglist contains pages. .PP Returns the top of the tree for insertion in the root object. .ie n .SS "@pglist = $p\->get_pages" .el .SS "\f(CW@pglist\fP = \f(CW$p\fP\->get_pages" .IX Subsection "@pglist = $p->get_pages" Returns a list of page objects in the document in page order .ie n .SS "$p\->find_prop($key)" .el .SS "\f(CW$p\fP\->find_prop($key)" .IX Subsection "$p->find_prop($key)" Searches up through the inheritance tree to find a property. .ie n .SS "$p\->add_font($pdf, $font)" .el .SS "\f(CW$p\fP\->add_font($pdf, \f(CW$font\fP)" .IX Subsection "$p->add_font($pdf, $font)" Creates or edits the resource dictionary at this level in the hierarchy. If the font is already supported even through the hierarchy, then it is not added. .ie n .SS "$p\->bbox($xmin, $ymin, $xmax, $ymax, [$param])" .el .SS "\f(CW$p\fP\->bbox($xmin, \f(CW$ymin\fP, \f(CW$xmax\fP, \f(CW$ymax\fP, [$param])" .IX Subsection "$p->bbox($xmin, $ymin, $xmax, $ymax, [$param])" Specifies the bounding box for this and all child pages. If the values are identical to those inherited then no change is made. \f(CW$param\fR specifies the attribute name so that other 'bounding box'es can be set with this method. .ie n .SS "$p\->proc_set(@entries)" .el .SS "\f(CW$p\fP\->proc_set(@entries)" .IX Subsection "$p->proc_set(@entries)" Ensures that the current resource contains all the entries in the proc_sets listed. If necessary it creates a local resource dictionary to achieve this. .ie n .SS "$p\->get_top" .el .SS "\f(CW$p\fP\->get_top" .IX Subsection "$p->get_top" Returns the top of the pages tree