Subject: | ‘trailer’ should not require a return |
The PDF spec does not require the word ‘trailer’ to be followed by a return. This is syntactically valid:
trailer<< /Size 34 /Root 23 0 R /Info 1 0 R /ID [ <e2ca9df8c15ea42d17d5d724f61808b1>
<e2ca9df8c15ea42d17d5d724f61808b1> ] >>
The attached patch fixes the module to allow such trailers.
Subject: | open_7avjz48f.txt |
--- /Users/sprout/.cpan/build/Text-PDF-0.31-rH_fyS/lib/Text/PDF/File.pm 2016-08-16 08:01:48.000000000 -0700
+++ lib/Text/PDF/File.pm 2017-02-26 14:54:42.000000000 -0800
@@ -1080,10 +1080,10 @@
{ $xlist->{$xmin++} = [$1, $2, $3]; }
}
- if ($buf !~ /^trailer$cr/oi)
+ if ($buf !~ /^trailer$ws_char*/oi)
{ die "Malformed trailer in PDF file $self->{' fname'} at " . ($fh->tell - length($buf)); }
- $buf =~ s/^trailer$cr//oi;
+ $buf =~ s/^trailer$ws_char*//oi;
($tdict, $buf) = $self->readval($buf);
$tdict->{' loc'} = $xpos;