# 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...) |