Subject: | PDF.pm does not grok ghostscript-generated PDF documents |
With version 1.11, and Perl 5.8.6, I cannot open documents generated by Ghostscript 7.05. In PDF::Parse, the TargetFile method contains the following code:
$self->{"Last_XRef_Offset"} = $offset;
ReadCrossReference_pass1 (\*FILE, $offset, $self);
$self->{"Info"} = $self->GetObject ($self->{"Trailer"}{"/Info"});
When it gets to the last line above, $self->{Trailer} is still undef, and so GetObject blows up. I am not yet sure why. Here is the end of one of the attached files:
xref
0 16
0000000000 65535 f
0000000548 00000 n
0000002737 00000 n
0000000489 00000 n
0000000894 00000 n
0000000746 00000 n
0000000596 00000 n
0000000338 00000 n
0000000015 00000 n
0000000319 00000 n
0000001247 00000 n
0000001041 00000 n
0000002498 00000 n
0000000684 00000 n
0000000714 00000 n
0000002477 00000 n
trailer
<< /Size 16 /Root 1 0 R /Info 2 0 R
Show quoted text
>>
startxref
2787
%%EOF
So the trailer is there, but the code doesn't locate it. When I run the attached script, it produces the following output:
./look portrait.pdf
portrait.pdf
Bad object reference '>' at ./look line 7
Bad object reference '>' at ./look line 7
Bad object reference '>' at ./look line 7
v=1.4
rot=
Message body not shown because it is not plain text.