<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEEDINFO "
   title="NEEDINFO - PDF hint table fails to load if PDFDoc is opened with stream start offset != 0"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=95061#c5">Comment # 5</a>
              on <a class="bz_bug_link 
          bz_status_NEEDINFO "
   title="NEEDINFO - PDF hint table fails to load if PDFDoc is opened with stream start offset != 0"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=95061">bug 95061</a>
              from <span class="vcard"><a class="email" href="mailto:seksfemfire@gmail.com" title="Ole Liabø <seksfemfire@gmail.com>"> <span class="fn">Ole Liabø</span></a>
</span></b>
        <pre>Here is a more comprehensive patch and a sample application. It fixes the
issues I have seen loading PDFs from a FileStream with startA != 0. Similar
problems could exists in the other stream types.


On Wed, Apr 27, 2016 at 9:44 AM, Ole Liabø <<a href="mailto:seksfemfire@gmail.com">seksfemfire@gmail.com</a>> wrote:

<span class="quote">> 1. I would like to withdraw my original patch - it does not solve all the
> issues. Sorry for committing it prematurely. The original bug still remains
> though.
> 2. "The main stream of a PDF always starts with offset 0": This is true if
> the filename PDFDoc constructor is used. But my bug refer to when the
> PDFDoc is created with a BaseStream as input. This stream could have a
> offset != 0, fex if you have concatenated many PDFS into one file. Today
> the code does not handle this case and the use of this PDFDoc constructor
> should be avoided until it's fixed. I'm working on a more comprehensive
> patch.</span >
>
<span class="quote">> On Tue, Apr 26, 2016 at 12:21 PM, <<a href="mailto:bugzilla-daemon@freedesktop.org">bugzilla-daemon@freedesktop.org</a>> wrote:</span >
>
<span class="quote">>> *<a href="show_bug.cgi?id=95061#c3">Comment # 3</a> <<a class="bz_bug_link 
          bz_status_NEEDINFO "
   title="NEEDINFO - PDF hint table fails to load if PDFDoc is opened with stream start offset != 0"
   href="show_bug.cgi?id=95061#c3">https://bugs.freedesktop.org/show_bug.cgi?id=95061#c3</a>> on
>> <a class="bz_bug_link 
          bz_status_NEEDINFO "
   title="NEEDINFO - PDF hint table fails to load if PDFDoc is opened with stream start offset != 0"
   href="show_bug.cgi?id=95061">bug 95061</a> <<a class="bz_bug_link 
          bz_status_NEEDINFO "
   title="NEEDINFO - PDF hint table fails to load if PDFDoc is opened with stream start offset != 0"
   href="show_bug.cgi?id=95061">https://bugs.freedesktop.org/show_bug.cgi?id=95061</a>> from Thomas
>> Freitag <<a href="mailto:Thomas.Freitag@alfa.de">Thomas.Freitag@alfa.de</a>> *
>>
>> I'm a little bit confused about it:
>> 1. If I parse the PDF of <a href="show_bug.cgi?id=95061#c2">comment 2</a> <<a class="bz_bug_link 
          bz_status_NEEDINFO "
   title="NEEDINFO - PDF hint table fails to load if PDFDoc is opened with stream start offset != 0"
   href="show_bug.cgi?id=95061#c2">https://bugs.freedesktop.org/show_bug.cgi?id=95061#c2</a>> i.e. with /utils/pdftoppm -png -f 1 -l 1
>> -cropbox I don't get any error messages.
>> 2. The main stream of a PDF always starts with offset 0
>> 3. The PDF spec says about the H entry in the "Linearization Parameter
>> Dictionary": offset1 shall be the offset of the primary hint stream from the
>> beginning(!!!) of the file.
>> 4. All offsets in poppler, i.e. also the xref offets, are offsets from the
>> beginning of a file and never add some hypothetical offet of substreams
>>
>> ------------------------------
>> You are receiving this mail because:
>>
>>    - You reported the bug.
>>
>></span >
></pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>