Subject: | Shouldn't parseObj trim whitespace before parsing? |
Hi,
Suppose we run simple program on attached PDF:
use warnings;
use strict;
use CAM::PDF;
my $doc = CAM::PDF->new('test.pdf');
$doc->cacheObjects();
CAM-PDF dies:
C:\>perl test.pl
Expected object open tag
0 25 0 obj^M<< /Length 50^M>...
Attached file is valid, but has somewhat peculiar syntax: xref table
gives offsets to objects, declaration of which is preceded by several
whitespace characters. That's ok according to specification, as I
understand.
Probably first condition in procedure parseObj
if (${$c} !~ m/ \G(\d+)\s+(\d+)\s+obj\s* /cgxms)
might be changed to
if (${$c} !~ m/ \G\s*(\d+)\s+(\d+)\s+obj\s* /cgxms)
Best regards,
Vadim
Subject: | test.pdf |
Message body not shown because it is not plain text.