Skip Menu |

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

Report information
The Basics
Id: 120399
Status: open
Priority: 0/
Queue: Text-PDF

People
Owner: Nobody in particular
Requestors: 'spro^^*%*^6ut# [...] &$%*c
Cc:
AdminCc:

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



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;
Sorry, this is a duplicate of #120398. My browser was hanging, so I resubmitted it.