PDF::F...TextBox(3pm)
π PDF::F...TextBox(3pm) π
okay bestie, welcome to the User Contributed Perl Documentation corner of the internet, where we're talking about PDF::FromHTML::Template::Element::TextBox β the little diva that writes text in a specified spot. no cap, that's literally its whole thing. π
β¨ NAME β¨
PDF::FromHTML::Template::Element::TextBox β to write text in a specified spot. that's it. that's the gig. π
π¦ NODE NAME π¦
TEXTBOX
like, when you're writing your template, this is the tag name you use. iykyk. β¨
π INHERITANCE π
PDF::FromHTML::Template::Element
it inherits from Element, so it's got that main-character lineage going on. π
πΈ ATTRIBUTES πΈ
every single one, we're going through them all, no skipping:
TEXTβ this is the text for this textbox. you can give it as a parameter, OR as character children of this node. whichever. defaults to''(the empty string). π«ΆALIGN/JUSTIFYβ this is the orientation of the text in the textbox. legal values are, and listen closely:Left(default β yes queen, left is the default)CenterRightFull(NOT IMPLEMENTED π so don't come for me if it doesn't work)
JUSTIFY is provided for backwards compatibility, and is deprecated. it's giving legacy. still works, but like⦠it's on the way out.
COLORβ this is the color of the text. πBGCOLORβ this is the color of background.BORDERβ this is a boolean specifying if a border should be drawn. currently, the border is drawn in the same color as the text. so if your text is pink, your border is pink. matching set, iconic. β¨LMARGIN/RMARGINβ these are the paddings within the textbox for the text. super useful if you are listing columns of numbers and don't want them to run into one another. personal space matters, bestie. πHβ normally, one would not setH, as it should be set by either theFONTorROWancestor. however, it can be useful to do the following:
<font h="8" face="Times-Roman">
<row>
<textbox w="100%" h="*4">Some text here</textbox>
</row>
</font>
that will create textbox which will occupy four rows of text at whatever size the font is set to. lowkey genius. π§
TRUNCATE_TEXTβ normally, a textbox will use as many rows as it needs to write the text given to it. (it will always respect its width requirement, even to the point of splitting words, though it tries hard to preserve words.) however, sometimes this behavior is undesirable.
set this to a true value and the height value will be a requirement, not an option. periodt. π
πΌ CHILDREN πΌ
None
no children. it's an independent queen. π
π AFFECTS π
Nothing
it doesn't affect anything else. it just does its little job and vibes. π¦
π DEPENDENCIES π
ROW
it needs ROW. they're a package deal. π«Ά
π USAGE π
<row h="8">
<textbox w="40%" text="Some text here"/>
<textbox w="60%"><var name="Param1"/> and stuff</textbox>
</row>
this will put two textboxes on the page at the current Y-position. the first will occupy 40% of the write-able space and contain the text "Some text here". the second will occupy the rest and contain the text from Param1, then the text " and stuff". π
bestie, note this: (this is the only way to mix parameters and static text in the same textbox.)
π AUTHOR π
Rob Kinyon (rkinyon@columbus.rr.com)
β SEE ALSO β
ROW
okay that's the whole page, you ate it up, no crumbs left. π β¨
and just so you know where this lore came from: this page is from perl v5.38.2, dated 2024-07-28, filed under the PDF::F...TextBox(3pm) manual. mwah, love you, go make some 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