Hi,
I am trying to use an external font (FreeMono.ttf) with PDF::API2::Simple but get the following error:
cannot find font '' ... at /usr/local/share/perl/5.10.1/PDF/API2/Resource/CIDFont/TrueType/FontFile.pm line 424.
#!/usr/bin/perl use strict "vars"; use PDF::API2::Simple; # Start new PDF my $page_number = 1; my $pdf = PDF::API2::Simple->new( file => 'test.pdf', header => \&header, footer => \&footer ); # Set a custom font my $font_obj = $pdf->pdf->ttfont($pdf,'FreeMono.ttf'); $pdf->add_font('MonoFont',$font_obj); $pdf->set_font('MonoFont'); # Add a page to the PDF $pdf->add_page(); # Insert some text # Set text color $pdf->fill_color( '#000000' ); for (my $i = 0; $i < 35; $i++) { my $text = "$i - Example text"; $pdf->text( $text, x => $pdf->margin_left, autoflow => 'on' ); } # Save PDF to disk $pdf->save();
In reply to External font with PDF::API2::Simple by Iceman1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |