Skip Menu |

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

Report information
The Basics
Id: 77508
Status: resolved
Worked: 5 min
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: _startdoc finds FIRST occurence of startxref in last 1024 bytes, though it should look for LAST
I think title of this report is self-explanatory. Suppose we have an incrementally saved PDF file. Changes, before last save, were very small -- so appended new objects, xref section and trailer all fit in 1024 bytes. That means, that now last 1024 bytes of a file contain TWO instances of word 'startxref'. The very beginning of procedure _startdoc finds first match, and therefore old version of a file is read. All this is easily fixed, if we add greedy .* to beginning of a pattern. Then last 'startxref' will be found, as expected. Best regards
Fixed in SVN, will be present in 1.58. Thanks. I think this is extremely unlikely to occur in real PDFs, but it's a very low performance cost and an easy patch so I accepted it.