I have an Intel MacPro running Mac OS X 10.5.6 (Perl 5.8.8) and a copy of PDF::API2. This has worked flawlessly for a long time.

Suddenly it has failed. There have been no changes at all to the machine apart from a recent 'Security Update', which I think had to do mostly with a loophole in Safari.

This minimal script:

my $pdf_in = PDF::API2->open($file_in) or die "$!\n";
my $pdf_out = PDF::API2->new or die "$!\n";

$page = $pdf_out->page;
$page->mediabox(595, 842);
$gfx = $page->gfx;
#$xo = $pdf_out->importPageIntoForm($pdf_in, 1);
#$gfx->formimage($xo, 0, 0, 1);

fails with the error message:

Undefined subroutine &Compress::Zlib::compress called at /Library/Perl/ 5.8.8/PDF/API2/Content.pm line 103.

However the folder 'Compress' is there, (alongside the folder 'PDF"which contains the module), the file 'Zlib' in that folder, and Zlib has a subroutine named 'compress'. So what can possibly have gone wrong here?

If the last two lines above are uncommented, the error message becomes:

Can't call method "infilt" on an undefined value at /Library/Perl/ 5.8.8/PDF/API2/Util.pm line 667.

presumably as a result of failure to access Zlib subroutines?

I have run 'repair permissions' which has not altered the situation and run out of ideas of what to do next.

I would be most grateful if anyone could help.

Alan Fry

Reply via email to