PDF::Builder
v3.028 Released, 31 December 2025
Please also see the
CPAN listing, the
GitHub entry, and the latest changes list.
A lawyer died and was standing in front of St. Peter at the Pearly Gates.
St. Peter said, “you can’t come in here… you have to go to the other place.”
But the lawyer was really good and pleaded his case to the point where St. Peter said, “OK… here’s what I’ll do. You will spend the same amount of time in Hell as you did on earth, and then you can spend the rest of eternity up here.”
The lawyer figured this wasn’t too bad of a deal, so he said “OK”.
St. Peter said, “Great… I’ll see you in 350 years.”
The lawyer said, “But, how is that possible… I’m only 65 years old!”
St. Peter said, “We go by billing hours.”
— Charles, Dilbert comic letters
Text::KnuthPlass uses the famed Knuth-Plass line-splitting algorithm (used in TeX and LaTeX) to break up a text string into a properly "shaped" paragraph. Certain rules are followed to not only efficiently pack the paragraph into a minimal number of lines, but also to minimize hyphenation, keep line density fairly constant, and take other measures to ensure that the output is typographically "nice looking". It works with both fixed-width fonts and with proportional (variable-width) fonts, where you supply the font library that calculates word lengths (e.g., PDF::Builder's advancewidth() method). Text::KnuthPlass permits varying line lengths, to allow text to flow around other objects, such as illustrations. It also makes use of (by default) Text::Hyphen, a library to indicate where words can be split (for hyphenation purposes).
See also this blog on Paragraph Shaping for a deeper dive into the subject.
All content © copyright 2005 – 2026
by Catskill Technology Services, LLC.
All rights reserved.
Note that Third Party software (whether Open Source or proprietary) on this
site remains under the copyright and license of its owners.
Catskill Technology Services, LLC does not claim copyright over such software.
This page is https://www.catskilltech.com/FreeSW/product/Text-KnuthPlass/title/Text%3A%3AKnuthPlass/freeSW_full
Search Quotations database.
Last updated Sat, 08 Apr 2023 at 3:14 PM