in reply to Re^4: External font with PDF::API2::Simple
in thread External font with PDF::API2::Simple
This works for me with a generic ttf font
#!/usr/bin/perl use strict; use warnings; use PDF::API2; my $text = "Some text "; my $pdf = PDF::API2->new(); my $page = $pdf->page; my $txt = $page->text; #my $font = $pdf->corefont('Helvetica-Bold', -encoding => 'latin1'); # alternatively, use TrueType fonts: # my $font = $pdf->ttfont('Verdana-Bold.ttf', -encoding => 'latin1'); my $font = $pdf->ttfont('./Generic.ttf', -encoding => 'latin1'); $txt->font($font, 25); $txt->translate(200, 550); $txt->fillcolor('black'); $txt->text($text); $pdf->saveas("$0.pdf");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: External font with PDF::API2::Simple
by Iceman1 (Novice) on Sep 22, 2011 at 08:59 UTC | |
by zentara (Cardinal) on Sep 22, 2011 at 09:51 UTC | |
by Iceman1 (Novice) on Oct 17, 2011 at 03:21 UTC |