PDF::Bu...F::Page(3)

✨ PDF::Builder::Basic::PDF::Page ✨

okay so bestie, welcome to the Page module from PDF::Builder::Basic::PDF β€” literally the thing that represents a PDF page πŸ’– (this is a User Contributed Perl Documentation page, and the module it's about is PDF::Builder::Basic::PDF::Page).

It inherits from PDF::Builder::Basic::PDF::Pages, and honestly? the family tree is giving "we share methods but we're built different" πŸ¦‹


πŸŽ€ NAME πŸŽ€

PDF::Builder::Basic::PDF::Page β€” Represents a PDF page 🌸

Inherits from PDF::Builder::Basic::PDF::Pages πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

So this class represents a page of output in PDF. It's also the one keeping track of the content stream, any resources (such as fonts) being switched, etc. like a little notebook πŸ““βœ¨

And yes, Page inherits from Pages because of a number of shared methods β€” but lowkey they are really structurally quite different. Fr fr. Same vibe, different skeleton πŸ’€


πŸ’œ INSTANCE VARIABLES πŸ’œ

A page has various working variables, and here's the one:

  • ' curstrm' β€” the currently open stream ✨
bestie I am copying this character for character, yes there's a space in there, do not come for me πŸ™ˆ

πŸ‘‘ METHODS πŸ‘‘

new

PDF::Builder::Basic::PDF::Page->new($pdf, $parent, $index)

Creates a new page based on a pages object (perhaps the root object) πŸŽ€

The page is also added to the parent at this point, so pages are ordered in a PDF document in the order in which they are created rather than in the order they are closed. That's the whole main character energy of ordering, no cap πŸ“š

Only the essential elements in the page dictionary are created here β€” all others are either optional or can be inherited. Keep it minimal, slay πŸ’…

The optional index value indicates the index in the parent list that this page should be inserted (so that new pages need not be appended) 🌟

ship_out

$p->ship_out($pdf)

Ships the page out to the given output file context 🚒✨


🌸 SIGN-OFF 🌸

That's the whole page, bestie β€” go forth and build PDFs, you absolute icon 🫢

This doc is from perl v5.42.0, dated 2026-01-17 β€” yeah, iconic behavior, we love to see it πŸ’–πŸŒˆβ­

πŸ“¦ where this page comes from