PDF::F...PageDef(3pm)

πŸ“¦
version 0.34 Β· 2 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

PDF::FromHTML::Template::Container::PageDef β€” bestie, this is the thing that gives you the page definition for a given page. That's it, that's the job, and it does it flawlessly. ✨

Oh also? The manual name is PDF::F...PageDef(3pm) and it's a User Contributed Perl Documentation page, so you already know it's giving community-coded excellence. 🫢


πŸŽ€ NODE NAME πŸŽ€

The node name is PAGEDEF. That's the name you type in your template, no cap. πŸ’…


πŸ¦‹ INHERITANCE πŸ¦‹

It inherits from PDF::FromHTML::Template::Container. So it's got that container main character energy running through its veins. πŸ‘‘


✨ ATTRIBUTES ✨

Okay so here's the whole menu of things you can set. Every single one, we're not skipping a thing. πŸ“

  • MARGINS / LEFT_MARGIN / RIGHT_MARGIN β€” this decides how much empty space gets kept on the left and right margins. And MARGINS is the shortcut β€” set it once and it sets both the left and right margins to the same value. Lazy girl math but make it efficient. πŸ’…
  • PAGE_HEIGHT / PAGE_WIDTH β€” the height and the width of the paper you want this pagedef to render to. And listen: if both of these aren't specified, then the value in PAGESIZE gets used instead. So it's them first, PAGESIZE as the backup dancer. 🌈
  • PAGESIZE β€” the paper size you want this pagedef to render to. Your choices are: Letter, Legal, A0, A1, A2, A3, and A4. Important: this attribute only gets used if PAGE_HEIGHT and PAGE_WIDTH are not set. So if you set those two, PAGESIZE is literally sitting there ignored. 😭
  • LANDSCAPE β€” the default orientation is portrait. But if LANDSCAPE is set to a true value, then PAGE_HEIGHT and PAGE_WIDTH get swapped. Flip it and reverse it, periodt. πŸ”₯
  • NOPAGENUMBER β€” if this is set to a true value, then this pagedef will not increment the __PAGE__ parameter. Super useful for title pages and the like, where you do not want the page count doing the most. πŸ™ˆ

🧚 CHILDREN 🧚

None. No children here, it's an only child and honestly? Thriving. πŸ’œ


🌸 AFFECTS 🌸

None. Doesn't affect anything else, it minds its business. πŸŽ€


⭐ DEPENDENCIES ⭐

None. Zero dependencies, she's self-sufficient. Iconic behaviour fr fr. πŸ‘‘


πŸ’– USAGE πŸ’–

Here's how you actually use it, bestie:

<pagedef pagesize="Legal" landscape="1">
  ... Children will render to a Legal-sized paper in landscape orientation ...
</pagedef>

So the children in there are gonna render to a Legal-sized paper in landscape orientation. Slay. ✨


🌈 NOTE 🌈

It is very possible, and often super useful, to have more than one pagedef in a given template. Yes, multiple. Go off. πŸ”₯

Also, the PAGEDEF does not have to be the direct child of the PDFTEMPLATE node. Sometimes it's useful to have something like this:

<pdftemplate>
  <loop name="PAGEDEFS">
    <pagedef
      pagesize="$PaperSize"
      landscape="$Orientation"
      nopagenumber="$TitlePage"
    >
      ... Children here ...
    </pagedef>
  </loop>
</pdftemplate>

Look at that loop doing its little loop thing. Gorgeous. πŸ¦‹


πŸ‘‘ AUTHOR πŸ‘‘

Rob Kinyon (rkinyon@columbus.rr.com) β€” thank you for your service, king. 🫢


πŸ’€ SEE ALSO πŸ’€

Nothing here, bestie. The section exists and it is empty. That's the whole vibe check. 😭


perl v5.38.2 Β· 2024-07-28 β€” that's the version and the date this page came from, mwah, take care of yourself and go render some gorgeous PDFs πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…

πŸ“¦ where this page comes from