Am Di 17. Jan 2012, 12:33:32, JHANNAH schrieb:
Show quoted text> What is 'floattext'?
Is "floating text" as description better ?
Show quoted text> You can use any ttf fonts you want.
> From the PDF::API2 docs, you do
> $font = $pdf->ttfont('/path/to/font.ttf');
I have defined:
my $pdf = PDF::API2->open('template.pdf');
my @directories = PDF::API2::addFontDirs
('C:/WINDOWS/Fonts/', 'C:/WINNT/Fonts/');
my $page = $pdf->openpage(0);
my $font = $pdf->ttfont('comic.ttf');
for the font access.
For placement the text with API2 the correct font will be used:
my $text = $page->text();
$text->font($font, 10);
$text->translate(48, 585);
$text->text('blah blah blah ...');
I use textblock with this code:
my $tb1 = PDF::TextBlock->new({
pdf => $pdf,
page => $pdf->openpage(0),
x => 40,
y => 490,
w => 510,
h => 500,
align => 'left',
fonts => {
b => PDF::TextBlock::Font->new({
pdf => $pdf,
font => $pdf->ttfont('C:/WINNT/Fonts/comic.ttf'),
}),
},
});
$tb1->text('blah blah blah ....'
$tb1->apply;
Not all the words was shown with the specified font. This problem often
occurs for line breaks ...
The font was correct shown if i used this text code:
$tb1->text('<b>blah <b>blah <b>blah <b>....'
Greetings, Andreas