in reply to Re: FlateDecode in CAM::PDF
in thread FlateDecode in CAM::PDF

thanks...I think I got it...an earlier post suggested removing Compress::Zlib...I renamed the PM and the error is gone! I have another concern with CAM::PDF getPageContent...I'm searching for that next.

Replies are listed 'Best First'.
Re^3: FlateDecode in CAM::PDF
by almut (Canon) on Nov 25, 2009 at 19:48 UTC
    suggested removing Compress::Zlib

    That's a bit strange (because Text::PDF::FlateDecode depends on Compress::Zlib).  But if it works... ;) — although a better option might be to properly install Compress::Zlib, such that it works (it in turn depends on the C library libz (aka "zlib")).

    # from Text/PDF/Filter.pm package Text::PDF::FlateDecode; use strict; use vars qw(@ISA $havezlib); @ISA = qw(Text::PDF::Filter); BEGIN { eval {require "Compress/Zlib.pm";}; $havezlib = !$@; } sub new { return undef unless $havezlib; my ($class) = @_; my ($self) = {}; $self->{'outfilt'} = Compress::Zlib::deflateInit(); $self->{'infilt'} = Compress::Zlib::inflateInit(); bless $self, $class; }

    And CAM::PDF goes like this:

    sub encodeOne ## no critic(Subroutines::ProhibitExcessComplexity) { my $self = shift; my $objnode = shift; my $filtername = shift; (...) my $filt; eval { require Text::PDF::Filter; my $package = "Text::PDF::$filtername"; $filt = $package->new; if (!$filt) { die; } }; if ($EVAL_ERROR) { warn "Failed to open filter $filtername (Text::PDF::$filterna +me)\n"; return 0; } (...)

    My guess would be that if that routine returns false, the PDF's content streams simply remain uncompressed  (which is valid PDF format, too, but larger...)