Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PDF::API2 Error

Status
Not open for further replies.

chrisw669

Technical User
Feb 19, 2002
43
0
0
US
I'm trying to get the program below to work on aix with perl 5.6.0 and am getting the following error:

Can't call method "outfilt" on an undefined value at /usr/opt/perl5/lib/5.6.0/PDF/API2/PDF/Dict.pm line 155.

The crazy thing is, i run the exact same thing under windows 2000 with activeperl and it works fine...


Code:
#!/usr/bin/perl

use PDF::API2;

my $pdf  = PDF::API2->new(-file => "$0.pdf");
$pdf->mediabox(595,842);
my $page = $pdf->page;
my $fnt = $pdf->corefont('Arial',-encoding => 'latin1'); 
my $txt = $page->hybrid;
$txt->textstart;
$txt->font($fnt, 20);
$txt->translate(100,800);
$txt->text("Text left-aligned 0123456789");
$txt->translate(500,750);
$txt->text_right("0123456789 Text right-aligned");
$txt->translate(300,700);
$txt->text_center("Text center-aligned");
$txt->textend;
$pdf->save;
$pdf->end();

any suggestions would be most appreciated.






 
Put in debug lines to find which method is causing the failure

--Paul
Code:
[b]open FH, ">>log.txt";[/b]
my $pdf  = PDF::API2->new(-file => "$0.pdf");
[b]print FH "Created new object\n";[/b]
$pdf->mediabox(595,842);
[b]print FH "Created Media box\n"[/b]
my $page = $pdf->page;
my $fnt = $pdf->corefont('Arial',-encoding => 'latin1'); 
my $txt = $page->hybrid;
$txt->textstart;

$txt->font($fnt, 20);
$txt->translate(100,800);
$txt->text("Text left-aligned 0123456789");
$txt->translate(500,750);
$txt->text_right("0123456789 Text right-aligned");
$txt->translate(300,700);
$txt->text_center("Text center-aligned");
$txt->textend;
$pdf->save;
$pdf->end();

You know what I mean

It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top