<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Annotations appear at the wrong place"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=96764#c6">Comment # 6</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Annotations appear at the wrong place"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=96764">bug 96764</a>
              from <span class="vcard"><a class="email" href="mailto:jose.aliste@gmail.com" title="Jose Aliste <jose.aliste@gmail.com>"> <span class="fn">Jose Aliste</span></a>
</span></b>
        <pre>This is what German found out.

After uncompressing the PDF you posted in Poppler:

$ pdftk bug.pdf output bug-u.pdf uncompress

You can find that /MediaBox is different than /TrimBox and /Cropbox.

<<
/pdftk_PageNum 1
/Rotate 0
/TrimBox [38 40 422 659]
/Resources 4 0 R
/Contents 24 0 R
/Parent 41 0 R
/Type /Page
/Thumb 1 0 R
/MediaBox [0 0 468 681]
/CropBox [0 40 422 659]
<span class="quote">>></span >

Just to test, I set all of them to [0 0 468 681] and poppler-glib-demo shows
the highlight text where it is expected.

poppler-qt5 frontend (the one used by Okular) has a method to normalize the
user coordinates with respect to the document. I believe that is what makes the
difference.

See
<a href="https://cgit.freedesktop.org/poppler/poppler/tree/qt5/src/poppler-annotation.cc#n202">https://cgit.freedesktop.org/poppler/poppler/tree/qt5/src/poppler-annotation.cc#n202</a>

poppler-glib does not have such normalization. I wonder why it should be
normalized in the front-end and not in the core of poppler (or have an API for
that).

Nevertheless, the way to solve it is having a helper either in poppler, to be
consumed by the frontends or add a function in poppler-glib to normalized the
coordinates.

Definitively not a bug in Evince. I am closing this bug, as once it is fixed in
Poppler, Evince will behave properly.</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>