in reply to Re: External font with PDF::API2::Simple
in thread External font with PDF::API2::Simple
#!/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('FreeMono.ttf'); $pdf->add_font('MonoFont',$font_obj); # 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();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: External font with PDF::API2::Simple
by zentara (Cardinal) on Sep 20, 2011 at 10:55 UTC | |
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 (Cardinal) on Apr 28, 2012 at 11:06 UTC | |
by Iceman1 (Novice) on Sep 21, 2011 at 04:23 UTC | |
by zentara (Cardinal) on Sep 21, 2011 at 14:12 UTC | |
by Iceman1 (Novice) on Sep 22, 2011 at 08:59 UTC | |
by zentara (Cardinal) on Sep 22, 2011 at 09:51 UTC | |
|