in reply to FlateDecode in CAM::PDF

Try installing Text::PDF — AFAICT from a quick look at the CAM::PDF sources, it uses the FlateDecode filter implementation of Text/PDF/Filter.pm.

In case that doesn't help, post the exact error message, and preferably also a code snippet that generates it.  Otherwise, it's a bit hard for us to help... :)

Replies are listed 'Best First'.
Re^2: FlateDecode in CAM::PDF
by fionbarr (Friar) on Nov 25, 2009 at 19:16 UTC
    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.
      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...)