CTS logo
hazy blue Catskill Mountains in distance



PDF::Builder::Basic::PDF::Pages - PDF pages hierarchical element

Inherits from PDF::Builder::Basic::PDF::Dict


A Pages object is the parent to other pages objects or to page objects themselves.



    PDF::Builder::Basic::PDF::Pages->new($pdf, $parent)
This creates a new Pages object in a PDF. Notice that the $parent here is not the file context for the object, but the parent pages object for these pages. If we are using this class to create a root node, $parent should point to the file context, which is identified by not having a Type of Pages. $pdf is the file object (or a reference to an array of one file object [3.016 and later, or multiple file objects earlier]) in which to create the new Pages object.


Returns the given page, using the page count values in the pages tree. Pages start at 0.


    $p->add_page($page, $page_number)
Inserts the page before the given $page_number. $page_number can be negative to count backwards from the END of the document. -1 is after the last page. Likewise $page_number can be greater than the number of pages currently in the document, to append.
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, leaving it unbalanced (slower performance, but still usable).


    @objects = $p->get_pages()
Returns a list of page objects in the document, in page order.


Searches up through the inheritance tree to find a property (key).


    $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.
CAUTION: if this method was used in older releases, the code may have swapped the order of $pdf and $font, requiring ad hoc swapping of parameters in user code, contrary to the POD definition above. Now the code matches the documentation.


    $p->bbox($xmin,$ymin, $xmax,$ymax, $param)

    $p->bbox($xmin,$ymin, $xmax,$ymax)
Specifies the bounding box for this and all child pages. If the values are identical to those inherited, no change is made. $param specifies the attribute name so that other 'bounding box'es can be set with this method.


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.


Returns the top of the pages tree.


Up (Parents)

Master Index
PDF::Builder -- Facilitates the creation and modification of PDF files
PDF::Builder::Basic::PDF -- Various utilities and support routines


PDF::Builder::Basic::PDF::Array -- Corresponds to a PDF array
PDF::Builder::Basic::PDF::Bool -- Holds the strings true or false
PDF::Builder::Basic::PDF::Dict -- PDF Dictionaries and Streams
PDF::Builder::Basic::PDF::File -- Holds the trailers and cross-reference tables for a PDF file
PDF::Builder::Basic::PDF::Filter -- Abstract superclass for PDF stream filters
PDF::Builder::Basic::PDF::Literal -- Literal PDF Object
PDF::Builder::Basic::PDF::Name -- Stores PDF names (things beginning with /)
PDF::Builder::Basic::PDF::Null -- PDF Null type object
PDF::Builder::Basic::PDF::Number -- Numbers in PDF
PDF::Builder::Basic::PDF::Objind -- PDF indirect object reference
PDF::Builder::Basic::PDF::Page -- Represents a PDF page
PDF::Builder::Basic::PDF::String -- PDF String type objects
PDF::Builder::Basic::PDF::Utils -- Utility functions for PDF library


All content © copyright 2005 – 2024 by Catskill Technology Services, LLC.
All rights reserved.
Note that Third Party software (whether Open Source or proprietary) on this site remains under the copyright and license of its owners. Catskill Technology Services, LLC does not claim copyright over such software.


This page is https://www.catskilltech.com/Documentation/PDF/Builder/Basic/PDF/Pages.html

Search Quotations database.

Last updated Sat, 09 Dec 2023 at 10:59 PM

Valid HTML 5

Thu, 18 Apr 2024 at 10:38 AM EDT