NAME
PDF::Make::Builder::Text - Word-wrapped text paragraph for PDF::Make
SYNOPSIS
$builder->add_text(
text => 'Hello, world!',
align => 'center',
margin => 10,
overflow => 1,
font => { size => 12, colour => '#333' },
);
DESCRIPTION
Renders a word-wrapped text paragraph at the current cursor position, handling line breaking, alignment, indentation, and automatic page overflow.
PROPERTIES
- text (Str, required)
-
The text content to render.
- align (Str, default
'left') -
Horizontal alignment:
'left','center', or'right'. - indent (Int, default 0)
-
Number of space-widths to indent the first line.
- padding (Num, default 0)
-
Inset in points applied on all sides of the text block.
- spacing (Num, default 0)
-
Extra vertical spacing in points between wrapped lines, and after the entire text block.
- pad (Str)
-
Padding character used for dot leaders (e.g. in TOC entries).
- pad_end (Str)
-
Text appended after the pad characters (e.g. a page number).
- margin (Num, default 5)
-
Vertical margin in points added after the text block.
- overflow (Bool, default 0)
-
When true, automatically creates new pages if the text exceeds the remaining space on the current page.
- font (HashRef)
-
Font overrides:
colour,size,family,line_height. - end_w (Num, default 0)
-
Set after rendering to the width of the last rendered line.
METHODS
- add($builder)
-
Renders the word-wrapped text onto the builder's current page, advancing the cursor. Returns
$self.
SEE ALSO
PDF::Make::Builder, PDF::Make::Builder::Font, PDF::Make::Builder::Text::H1