PDF::API2::Text

Subclassed from PDF::API2::Content.

$txt = PDF::API2::Text->new @parameters

Returns a new text content object (called from $page->text).

%state = $txt->textstate %state

Sets or gets the current text-object state.

($tx,$ty) = $txt->textpos

Gets the current estimated text position.

$txt->matrix $a, $b, $c, $d, $e, $f

Sets the matrix.

PLEASE NOTE: This method is not expected to be called by the user and else will 'die'. This was implemented to keep proper state in the text-object, so please use transform, transform_rel, translate, scale, skew or rotate instead.

$txt->transform_rel %opts

Sets transformations (eg. translate, rotate, scale, skew) in pdf-canonical order, but relative to the previously set values.

Example:

$txt->transform_rel(
	-translate => [$x,$y],
	-rotate    => $rot,
	-scale     => [$sx,$sy],
	-skew      => [$sa,$sb],
)
$txt->font $fontobj,$size
$spacing = $txt->charspace $spacing
$spacing = $txt->wordspace $spacing
$spacing = $txt->hspace $spacing
$leading = $txt->lead $leading
$rise = $txt->rise $rise
$rendering = $txt->render $rendering
$txt->cr $linesize

takes an optional argument giving a custom leading between lines.

$txt->nl
$txt->distance $dx,$dy
$width = $txt->advancewidth $string

Returns the width of the string based on all currently set text-attributes.

$width = $txt->text $text, %options

Applys text to the content and optionally returns the width of the given text.

You can use the -utf8 option to give the text in utf8.

$txt->text_center $text, %options

You can use the -utf8 option to give the text in utf8.

$txt->text_right $text, %options

You can use the -utf8 option to give the text in utf8.

($flowwidth, $overflow) = $txt->text_justify $text , -width => $width [, -overflow => 1 ] [, -underflow => 1 ] [, %options ]

If -overflow is given, $overflow will contain any text, which wont fit into width without exessive scaling and $flowwidth will be 0.

If -underflow is given, and $text is smaller than $width, $flowwidth will contain the delta between $width and the text-advancewidth AND text will typeset using $txt->text.

You can use the -utf8 option to give the text in utf8.

$txt->paragraph $text, %options, -x => $xorg, -y => $yorg, -w => $width, -h => $height, -flindent => $firstlineindent, -lead => $lead

You can use the -utf8 option to give the text in utf8.

AUTHOR

alfred reibenschuh

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 36:

'=item' outside of any '=over'

Around line 671:

You forgot a '=back' before '=head1'