in reply to Re^2: External font with PDF::API2::Simple
in thread External font with PDF::API2::Simple
Have you read closely the perldoc for the module?
I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh
You can optionally pass a font object and font size if you have loade +d an external font. my $font_obj = $pdf->pdf->ttfont('new_font.ttf'); $pdf->add_font('NewFont', $font_obj, '12'); Refer to PDF::API2 for the various font methods, like "ttfont", + available.
Just from that, it appears that your $pdf->add_font('MonoFont',$font_obj); needs a font size specification added.
Furthermore, looking through the examples in PDF::API2, there are code constructs like
# from examples/*02_truetype_fonts-pl foreach $fe (qw( adobe-standard cp437 cp850 latin1 )) { print STDERR "$fn ($fe)\n"; $font=$pdf->ttfont($fn , -encode =>$fe); # from examples/*02_synthetic_fonts-pl use PDF::API2; use PDF::API2::SynFont; $pdf=PDF::API2->new; $f1=$pdf->corefont('Arial',-encode=>'latin1'); $f2=$pdf->corefont('Helvetica-Bold',-encode=>'latin1'); $f3=$pdf->corefont('Helvetica-Oblique',-encode=>'latin1'); $f4=$pdf->corefont('Helvetica-BoldOblique',-encode=>'latin1'); my $font=PDF::API2::SynFont->new_api($pdf,$f1,-bold=>4);
so you may need to specify an encoding, or at least run some simple examples to see how to get your font code right.
I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: External font with PDF::API2::Simple
by Speedy G (Initiate) on Apr 27, 2012 at 23:58 UTC | |
by Ruilong Deng (Initiate) on Dec 13, 2014 at 12:05 UTC | |
by zentara (Archbishop) on Apr 28, 2012 at 11:06 UTC | |
Re^4: External font with PDF::API2::Simple
by Iceman1 (Novice) on Sep 21, 2011 at 04:23 UTC | |
by zentara (Archbishop) on Sep 21, 2011 at 14:12 UTC | |
by Iceman1 (Novice) on Sep 22, 2011 at 08:59 UTC | |
by zentara (Archbishop) on Sep 22, 2011 at 09:51 UTC | |
by Iceman1 (Novice) on Oct 17, 2011 at 03:21 UTC |
In Section
Seekers of Perl Wisdom