in reply to PDF::API2 font
I think the font directory should not be part of the fontname in ->ttfont(...) (update: actually, it doesn't matter, both work... but then you wouldn't need to use addFontDirs() ).
This works for me:
#!/usr/bin/perl use PDF::API2; PDF::API2::addFontDirs('/opt/Adobe/Reader9/Resource/Font'); my $pdf = PDF::API2->new(); my $page = $pdf->page(); my $text = $page->text(); my $font = $pdf->ttfont('MyriadPro-Regular.otf', -encoding => 'latin1' +); $text->font($font, 12); $text->translate(100, 100); $text->text('Hello World'); $pdf->saveas("hello.pdf");
Which error(s) are you getting? What exactly doesn't work, i.e. what does happen?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: PDF::API2 font
by shibu_pu (Acolyte) on Sep 23, 2009 at 11:16 UTC | |
by almut (Canon) on Sep 23, 2009 at 11:35 UTC | |
by shibu_pu (Acolyte) on Sep 24, 2009 at 06:24 UTC | |
by shibu_pu (Acolyte) on Nov 07, 2009 at 05:21 UTC |