Bug 695130 - Highligh Annotation is badly rendered in Adobe Reader
Summary: Highligh Annotation is badly rendered in Adobe Reader
Status: RESOLVED FIXED
Alias: None
Product: MuPDF
Classification: Unclassified
Component: mupdf (show other bugs)
Version: 1.3
Hardware: All All
: P4 normal
Assignee: Paul Gardiner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-02 07:19 UTC by Fabio Mitrano
Modified: 2018-11-09 13:17 UTC (History)
3 users (show)

See Also:
Customer:
Word Size: ---


Attachments
Attachments 1 and 2 (11.71 KB, application/octet-stream)
2014-04-02 07:19 UTC, Fabio Mitrano
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fabio Mitrano 2014-04-02 07:19:38 UTC
Created attachment 10802 [details]
Attachments 1 and 2

Hi,

I'm using the latest muPDF library available on Git (last clone I made: 02 April 2014). The target platform is Android.
When I try to add highlight annotations they are correctly rendered if I use the same muPDF library both for manipulating and rendering the PDF file.
However the quadPoints that are calculated for the highlight annotations are inserted in an order that is different from the one used by other rendering engine such as Adobe Reader (if you open the attachment 1 [details] by means of Adobe Reader and you try to click on the highlight annotation you can see that quadpoints order is inverted).
In detail the Java method MuPDFPageView.markupSelection is returning the following quadpoints order:
left bottom, right bottom, right top, left top
instead Adobe Reader is using the order:
left bottom, right bottom, left top, righ top.

I tried to change the quadpoints order returned by MuPDFPageView.markupSelection to be aligned with the one used by Adobe Reader however muPDF is not able to correctly save and render it. In such a case it is able to highlight only half of the selected text (you can see it with attachment 2 [details]). However in such a case if you select the annotation with Adobe Reader you can see that the selected rectangle is right.

I think the different behaviour of the highlight annotation (when it is shown and when it is selected) is due to the correct appearance (AP) and the bad quadPoints.


Thanks a lot for your work,
Kind Regards
Comment 1 Matt Holgate 2014-06-30 02:53:44 UTC
kens had some great insights and a suggested fix for this problem on IRC: 

http://ghostscript.com/irclogs/2014/06/30.html
Comment 2 Matt Holgate 2014-06-30 04:02:19 UTC
This is a core issue, and not Android specific, so removing the Android tag.
Comment 4 Tor Andersson 2018-11-09 13:17:39 UTC
We have found and fixed the quadpoint ordering to match Adobe both when rendering and creating annotations.