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

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

πŸ’– 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)
    • Center
    • Right
    • Full (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 set H, as it should be set by either the FONT or ROW ancestor. 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