Font Embedding in PDF

Discussion in 'Perl Misc' started by Aqua, May 11, 2004.

  1. Aqua

    Aqua Guest

    Group,

    I am using PDF::API2 perl module to create and modify few PDF files. I
    am adding few strings to the PDF. But when I run through PitStop tool
    I am getting font Helvetica not embedded.

    How do I embed standard core font like Helvetica in a PDF?

    Regards
    Dominic

    ================ Sample ==============
    #!/usr/bin/perl

    use PDF::API2;
    $pdf=PDF::API2->new;

    $fn = "Helvetica";
    $font=$pdf->corefont($fn,1);
    $page = $pdf->page;
    $page->mediabox(595,842);
    $txt=$page->text;
    $txt->translate(100,700);
    $txt->font($font, 18);
    $txt->lead(18);
    $txt->text('Hello World !');
    $pdf->saveas("$0.pdf");

    $pdf->end();
    exit;

    __END__
     
    Aqua, May 11, 2004
    #1
    1. Advertising

  2. In article <>,
    (Aqua) wrote:

    > Group,
    >
    > I am using PDF::API2 perl module to create and modify few PDF files. I
    > am adding few strings to the PDF. But when I run through PitStop tool
    > I am getting font Helvetica not embedded.
    >
    > How do I embed standard core font like Helvetica in a PDF?


    I think the whole point of a "core" font is that it doesn't need to be
    embedded -- it is (by spec, I believe) supposed to be available to every
    PDF display device.

    If you try changing the font to 'Times-Roman', does PitStop still
    complain? If so, you might try looking at its preferences and see if
    there is something about warning when core fonts aren't present...

    Also, I believe that you can just do:

    my $font = $pdf->corefont('Helvetica');

    without needing to provide a size at this point.

    Ricky

    --
    Pukku
     
    Richard Morse, May 11, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bassam A. Jarad

    Font Embedding in HTML

    Bassam A. Jarad, Oct 28, 2003, in forum: HTML
    Replies:
    12
    Views:
    7,575
    sti.creative
    Sep 10, 2007
  2. Replies:
    0
    Views:
    698
  3. mttc
    Replies:
    2
    Views:
    2,459
    Roedy Green
    Jul 3, 2009
  4. Ricardo Pog
    Replies:
    1
    Views:
    487
    Austin Ziegler
    Mar 26, 2008
  5. Sean Nakasone
    Replies:
    1
    Views:
    426
    Farrel Lifson
    Apr 14, 2008
Loading...

Share This Page