[Poppler-bugs] [Bug 104565] UK tax form PDF has jumbled text

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Jan 10 20:37:19 UTC 2018


https://bugs.freedesktop.org/show_bug.cgi?id=104565

--- Comment #3 from Jason Crain <jason at inspiresomeone.us> ---
CairoFontEngine.cc is caching fonts based on the indirect reference number and
generation under the assumption that they will be unique, but a font on page 2
and 3 are aliasing so it uses the wrong font.  Splash is probably doing
something similar.

Two different fonts have the same number and generation because these fonts
don't really have an indirect reference due to the way the way the PDF defines
the resources and font dictionaries:

7 0 obj
<<
  /Resources 8 0 R
  /Type /Page
  ... other page entries ...
>>
endobj

8 0 obj
<<
  /Font <<
    /T1 <<
      ... font dictionary entries ...
    >>
  >>
>>

The GfxFontDict constructor has code to generate a fake reference based on the
/Font dictionary's number but that doesn't work well in this PDF because the
Font dictionary doesn't have an indirect reference either.

This appears to be fixed in XPDF 4.00 because the GfxFontDict constructor now
includes code to generate the fake reference based on a hash instead.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler-bugs/attachments/20180110/9965610a/attachment.html>


More information about the Poppler-bugs mailing list