Ubuntu – Evince highlights wrong regions in PDF

evincepdfpoppler

This is an old bug, it seems to be not Evince's own fault but the bug is from Poppler. The specific cause of the bug has been identified (it's the calculation of some coordinates) but as of 2019 it is still not fixed in Ubuntu.

This is an example: I tried to highlight the second sentence of the first paragraph, but this is what I get:
enter image description here

That means all the users of Ubuntu cannot highlight PDF texts using Evince — this is such a basic function.

Is there any way to update Poppler to the correct version such that Evince works?

Please do not mark this as a duplicate question UNLESS one can provide a specific way to upgrade Poppler and resolve this problem.

Best Answer

According to the following bug report, the problem is related to how Poppler handles cropboxes. They say it is fixed in Poppler 0.86.0 onwards.

However, if you are still facing this problem (as it was my case) you can modify the PDF so that it does not have cropboxes. I have been able to do this by calling pdfjam without any arguments:

pdfjam original_file.pdf -o fixed_file.pdf

I am sure there must be better ways to do it, but I have only found this.

I have tested this method with this pdf and it works.