GNOME Bugzilla – Bug 768246
Annotations appear at the wrong place
Last modified: 2017-11-05 18:29:15 UTC
Created attachment 330659 [details] screenshot When doing annotations on old an old pdf the annotation (yellow highlight) shows up at the wrong position. See the attached screenshot, where I have tried to annotate the headline of the text ("Time series properties of an artificial stock market") - but this happens for every part of text in the pdf (which I have tried). However I get the annotation window when i click on the text which I annotated and not when I click on the yellow area. Since the pdf on which I have noticed this bug is copyrighted I will not upload it here (you can download it here: http://www.sciencedirect.com/science/article/pii/S0165188998000815 or send me an Email if you do not have access to it). The pdf is PDF-1.2 and was created using "Acrobat Distiller 3.02 for Power Macintosh" in the year 1999. This is not the first old pdf in which I have noticed this behaviour, however newer pdf's usually work as expected.
Thank you for reporting the issue. This issue is in poppler, the library used by Evince to render PDF documents, as it is reproducible with poppler-glib-demo. Please, file a bug in https://bugs.freedesktop.org/enter_bug.cgi?product=poppler and add a link here to such bug.
For what it is worth, ezPDF does not show the problem. I mention it because ezPDF uses code (proprietary license) from xpdf. So, it is solvable.
Okay, I have filed the bug here: https://bugs.freedesktop.org/show_bug.cgi?id=96764
this might be still a bug in evince, since this problem does not occur with okular (see bugreport for the poppler library for the first page of the pdf to try it yourself)
(In reply to ralf.evince from comment #4) > this might be still a bug in evince, since this problem does not occur with > okular (see bugreport for the poppler library for the first page of the pdf > to try it yourself) Nope. As I said in comment #1 the issue is reproducible with poppler-glib-demo. The problem maybe specific to the glib frontend of poppler, but that still is poppler. I just tried it again with poppler master, and the issue is there wit poppler-glib-demo. okular uses a different frontend (qt) of poppler, and there may be differences.
Indeed. 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] >> 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 https://cgit.freedesktop.org/poppler/poppler/tree/qt5/src/poppler-annotation.cc#n202 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.
*** Bug 749342 has been marked as a duplicate of this bug. ***
*** Bug 767491 has been marked as a duplicate of this bug. ***
*** Bug 744220 has been marked as a duplicate of this bug. ***
*** Bug 772498 has been marked as a duplicate of this bug. ***