PDF::F...PageDef(3pm)
π 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. AndMARGINSis 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 inPAGESIZEgets used instead. So it's them first,PAGESIZEas the backup dancer. πPAGESIZEβ the paper size you want this pagedef to render to. Your choices are:Letter,Legal,A0,A1,A2,A3, andA4. Important: this attribute only gets used ifPAGE_HEIGHTandPAGE_WIDTHare not set. So if you set those two,PAGESIZEis literally sitting there ignored. πLANDSCAPEβ the default orientation is portrait. But ifLANDSCAPEis set to a true value, thenPAGE_HEIGHTandPAGE_WIDTHget 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
- debian trixie: libpdf-fromhtml-perl 0.34-1 Β· CC0-1.0
- ubuntu resolute: libpdf-fromhtml-perl 0.34-1 Β· CC0-1.0
- ubuntu stonking: libpdf-fromhtml-perl 0.34-1 Β· CC0-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms