in reply to Re^3: CAM::PDF w/ Text::PDF::FlateDecode
in thread CAM::PDF w/ Text::PDF::FlateDecode

I ran in the same error and here is the "empirical" way I found to solve it.
I'm working on a Windows XP machine with Activeperl 5.10.0 Build 1003. My CAM-PDF module version is 1.13, the versions of its dependecies are Text-PDF module version 0.29 and Crypt-RC4 module version 2.02

As CaMelRyder reported, from this simple program:
use strict; use warnings; use CAM::PDF; my $pdf = CAM::PDF->new("test.pdf"); # test.pdf is the existing pdf my $string = $pdf->getPageText(1); open (C, ">", "test.txt"); print C $string; # print extracted string
.. I obtained this error:
Failed to open filter FlateDecode (Text::PDF::FlateDecode) Unrecognized type in parseAny: 1 ═╩▓▀O▒:♠n╩...
the really strange thing was that adding ONE LINE at the beggining of the program:
@INC=('C:/Perl/lib','C:/Perl/site/lib','.'); # THIS LINE IS ADDED use strict; use warnings; use CAM::PDF; my $pdf = CAM::PDF->new("test.pdf"); # test.pdf is the existing pdf my $string = $pdf->getPageText(1); open (C, ">", "test.txt"); print C $string; # print extracted string
everything worked fine and no error message was displayed.
What I've done is a very little change to the Perl special variable @INC which is: (from perldoc)
"The array @INC contains the list of places that the use construct look for its library files."

Usually the content of this array @INC is ('C:/Perl/site/lib','C:/Perl/lib','.') I verified that by typing from the command line of my computer: perl -de0 in this way I opened the perl debugger and I typed: x @INC
On resume, I obtained that:

usually _______________ => @INC is ____ ('C:/Perl/site/lib','C:/Perl/lib','.')
to make CAM-PDF working => @INC must be ('C:/Perl/lib','C:/Perl/site/lib','.') => I INVERTED THE FIRST TWO ELEMENTS OF @INC

I DON'T KNOW THE REASON OF ALL THAT, AND I WAIT FOR EXPLANATIONS FROM SOME PERLMONK MORE EXPERT THAN ME.

Replies are listed 'Best First'.
Re^5: CAM::PDF w/ Text::PDF::FlateDecode
by ravi_kk (Initiate) on Aug 07, 2009 at 13:30 UTC
    Hi Don't get worry If you get the following error srir@leo ~$ perl test.pl Failed to open filter FlateDecode (Text::PDF::FlateDecode) Unrecognized type in parseAny: 1 V[s6+ߴ/.(|S^MwJgG7m$... we can fix the above just installing the following Perl Modules in the order . Crypt-RC4-2.02 \ Compress-Raw-Zlib-2.020 \ Compress-Zlib-2.015 \ Digest-MD5-2.38 \ Getopt-Long-2.38 \ Compress-Zlib-Perl-0.02 \ IO-Compress-2.020 \ Pod-Parser-1.38 Test-Simple-0.92 Text-PDF-0.29 Thanks Phani Krishna Jampala Sr Software Engineer (Build & Release)
Re^5: CAM::PDF w/ Text::PDF::FlateDecode
by ravi_kk (Initiate) on Aug 07, 2009 at 13:39 UTC
    Hi
    Dont worry if you face the following error

    srir@leo ~$ perl test.pl
    Failed to open filter FlateDecode (Text::PDF::FlateDecode)
    Unrecognized type in parseAny:
    1 V[s6+ߴ/.(|S^MwJgG7m$...

    we can resolve the above issue by installing of the following perlmodules in order

    Crypt-RC4-2.02 \
    Compress-Raw-Zlib-2.020 \
    Compress-Zlib-2.015 \
    Digest-MD5-2.38 \
    Getopt-Long-2.38 \
    Compress-Zlib-Perl-0.02 \
    IO-Compress-2.020 \
    Pod-Parser-1.38
    Test-Simple-0.92
    Digest-MD5-2.38
    Text-PDF-0.29
    CAM-PDF-1.52


    Thanks
    Phani Krishna Jampala
    Sr Software Engineer (build & release)
Re^5: CAM::PDF w/ Text::PDF::FlateDecode
by Anonymous Monk on Oct 29, 2008 at 11:14 UTC
    thats odd, because the standard @INC order is
    D:\>perl -le " print for @INC " D:/Perl/lib D:/Perl/site/lib .
      The standard order you refer to is true in Linux installation of Perl (or in own-compiled installations of perl)
      As I told you, I have Activeperl on Windows XP v5.10.0 build 1003 285500; as you can see also in this post http://www.perlmonks.org/?node_id=704795 in Activeperl the order of the content of @INC is:
      C:\>perl -le "print for @INC" C:/Perl/site/lib C:/Perl/lib .
        ANOTHER IMPORTANT UPDATE TO THE PROBLEM WITH CAM-PDF

        I've asked advice to the CAM-PDF author and he put me on the right way by saying that this error with CAM-PDF:
        Failed to open filter FlateDecode (Text::PDF::FlateDecode) Unrecognized type in parseAny: 1 --__O_:n-Hl-0[tu!-...
        ... is FAULT of Compress::Zlib module.

        Actually I had Compress::Zlib installed, in spite of it not being a dependency of CAM-PDF. I installed Compress::Zlib since it was a dependency of PDF-API2 module, another module to handle pdf files, but I've never been able to use PDF-API2 due to some errors.

        So I've tried to uninstall PDF-API2 and Compress::Zlib and, magic, THE ERROR WITH CAM-PDF HAS DISAPPEARED AND EVERYTHING WORKS FINE.