1 2 3 4 5 6 7 8 9 10 11 12
use PDF::API2; use utf8; my $pdf = PDF::API2->new(); my $page = $pdf->page(); $page->mediabox('A4'); my $font = $pdf->corefont('Helvetica'); my $text = $page->text(); $text->font($font, 20); $text->translate(200, 700); $text->text('1 €'); $pdf->saveas('new.pdf');
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
#!/usr/bin/perl use strict; use warnings; use 5.010; use PDF::API2; use utf8; my $pdf = PDF::API2->new(); my $page = $pdf->page(); $page->mediabox('A4'); # Helevetica Bold Oblique my $font1 # = $pdf->corefont('Helvetica-Oblique'); = $pdf->psfont( '/Bibliothek/Fonts/Type 1/Adobe/hvbo____.pfb', -pfmfile => '/Bibliothek/Fonts/Type 1/Adobe/hvbo____.pfm' ); # Euro Sans Bold Italic my $font2 = $pdf->psfont( '/Bibliothek/Fonts/XeroxPhaser/eurofont/_2bi____.pfb', -pfmfile => '/Bibliothek/Fonts/XeroxPhaser/eurofont/_2bi____.pfm' ); my $text = $page->text(); $text->font($font1, 20); $text->translate(200, 700); $text->text('1'); $text->font($font2, 20); $text->text('€'); $pdf->saveas('new-t1.pdf');
1 2 3 4 5 6 7 8
use PDF::Reuse; use utf8; prFile('template.pdf'); prTTFont("arial.ttf"); prFontSize(12); prText(100,700,"100 €"); prEnd;