Subject: | CAM::PDF 1.58 "Expected object open tag" |
Date: | Thu, 11 Jul 2013 12:09:54 -0700 |
To: | bug-CAM-PDF [...] rt.cpan.org |
From: | "G. Paul Ziemba" <p-fbsd-bugs [...] ziemba.us> |
Thanks in advance for any suggestions:
code:
use CAM::PDF; # 1.58
$pdf = CAM::PDF->new($fn, undef, undef, {fault_tolerant => 1});
output:
Expected object open tag
0 ^M
xref^M2 15 ^M0000000016 00000 n^M
0000000...
PDF file is attached. It was produced on Win2K using ABBYY FineReader
(see meta-info in file). I'm running CAM::PDF 1.58 on FreeBSD 9.X.
Acroread 8.1.7 and xpdf 3.03 display the file OK.
For what it's worth, I tried fiddling with PDF.pm per item 3 of bug
78727 and found that if I added two blocks of testing for \n or \r,
I stopped getting the "Expected object open tag" error message, but
that the resulting value from $pdf->getPageText text had extra spaces
embedded. I'm clearly missing something...
sub _buildxref
{
.
.
.
my $trailer;
# BEGIN gpz - added per https://rt.cpan.org/Public/Bug/Display.html?id=78727
my $stuff=substr $self->{content}, $startxref, 1;
if($stuff eq "\n" || $stuff eq "\r")
{
$startxref++;
print __LINE__," $self->{pdfversion} - position was off a little\n";
}
$stuff=substr $self->{content}, $startxref, 1;
if($stuff eq "\n" || $stuff eq "\r")
{
$startxref++;
print __LINE__," $self->{pdfversion} - position was off a little\n";
}
# END - added per https://rt.cpan.org/Public/Bug/Display.html?id=78727
--
G. Paul Ziemba
FreeBSD unix:
11:51AM up 85 days, 23:09, 1 user, load averages: 1.00, 0.81, 0.81
Message body not shown because it is not plain text.