Skip Menu |

This queue is for tickets about the CAM-PDF CPAN distribution.

Report information
The Basics
Id: 76512
Status: resolved
Priority: 0/
Queue: CAM-PDF

People
Owner: Nobody in particular
Requestors: futuramedium [...] yandex.ru
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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
Download test.pdf
application/pdf 5.5k

Message body not shown because it is not plain text.

Interesting. I think the spec is ambiguous about whether the whitespace is allowed ("The byte offset is a 10-digit number, padded with leading zeros if necessary, giving the number of bytes from the beginning of the file to the beginning of the object.") but I think it's within the spirit of the spec and should be harmless, so I'll allow it. Thanks! This will appear in CAM-PDF 1.58