in reply to Re^4: External font with PDF::API2::Simple
in thread External font with PDF::API2::Simple

Why not go back to PDF::API2 ? because the simple has left PDF::API2::Simple. :-)

This works for me with a generic ttf font

#!/usr/bin/perl use strict; use warnings; use PDF::API2; my $text = "Some text "; my $pdf = PDF::API2->new(); my $page = $pdf->page; my $txt = $page->text; #my $font = $pdf->corefont('Helvetica-Bold', -encoding => 'latin1'); # alternatively, use TrueType fonts: # my $font = $pdf->ttfont('Verdana-Bold.ttf', -encoding => 'latin1'); my $font = $pdf->ttfont('./Generic.ttf', -encoding => 'latin1'); $txt->font($font, 25); $txt->translate(200, 550); $txt->fillcolor('black'); $txt->text($text); $pdf->saveas("$0.pdf");

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

Replies are listed 'Best First'.
Re^6: External font with PDF::API2::Simple
by Iceman1 (Novice) on Sep 22, 2011 at 08:59 UTC
    Simple sure has left home :-)
    Is there a way I could use the PDF::API2 code you show within a program that is otherwise using PDF::API2::Simple?
    Or would I have to convert all of my code to PDF::API2?
      Is there a way I could use the PDF::API2 code you show within a program that is otherwise using PDF::API2::Simple?

      I tried a few examples, but no success. I would go back to straight PDF::API2 myself. Have you tried contact the author of PDF::API2::Simple?


      I'm not really a human, but I play one on earth.
      Old Perl Programmer Haiku ................... flash japh
        Hi,
        Thank you zentara and kesler for your assistance.
        I sent the module author a message but didn't get a reply.
        Zentara, as per your suggestion, I have studied up and re-written my code in PDF:API2 which is working great.
        I guess this also has the advantage of extra functionality and I also have a greater working knowledge making PDF's than I would have otherwise.

        Thanks again.