ordinary "Compress::Zlib" will do. Below is one of my scripts, also I have a script that reorganizes PDF to become in all uncompressed objects.
use strict;
use Compress::Zlib;
open my $fh, '<d:\WORK\Documentation\protect\PSAX1250_IG.pdf';
binmode $fh;
binmode STDOUT;
undef $/;
my @r = <$fh>=~/\/FlateDecode\s+\/Length\s+(\d+).*?stream\r\n(.*?)ends
+tream/sg;
my $i;
for ($i=0;$i<$#r;$i+=2) {
my ($l,$s) = ($r[$i],$r[$i+1]);
print STDERR "l=$l,".length($s),"\n";
$s = substr($s,0,$l);
my ($d,$stat) = inflateInit();
print STDERR "stat=$stat\n";
my ($out);
($out,$stat) = $d->inflate($s);
print STDERR "stat=$stat\n";
print STDERR "length(\$out)=",length($out),"\n";
print "$out\n\n\n-------------------\n";
}
Courage, the Cowardly Dog
things, I do for love to perl...
|