Bug 410642 - Reviews are not show
Summary: Reviews are not show
Status: RESOLVED NOT A BUG
Alias: None
Product: okular
Classification: Applications
Component: PDF backend (show other bugs)
Version: 1.7.3
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-06 08:53 UTC by tutonis
Modified: 2019-08-08 17:22 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
annotated pdf (133.54 KB, application/pdf)
2019-08-07 06:00 UTC, tutonis
Details
Screenshot of pdf viewers (60.58 KB, image/jpeg)
2019-08-07 06:18 UTC, tutonis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tutonis 2019-08-06 08:53:19 UTC
SUMMARY

Saving reviews doesn't work 100% correct - the review object is being saved and shown in pdf viewers review panel (correct), but the visual representation of review gets corrupted (the highlight color/line/etc is not shown on actual pdf). Different viewers exhibit different behaviors

STEPS TO REPRODUCE

1. Create highlight review
2. Create freehand line
3. Save document
4. Open in firefox/chrome/foxit/zathura pdf viewer

OBSERVED RESULT

chrome, okular, zathura - shows 1 highlight, 1 line (correct!)
firefox - shows 0 highlight, 0 line
foxit - shows 1 highlight, 0 line (always 1 behind)


EXPECTED RESULT

All viewers should show 1 highlight and 1 line:
visible in pdf reviews (this works)
actually drawn in pdf (this doesn't)


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE neon 18.04
KDE Plasma Version: 5.16.4
KDE Frameworks Version: 5.60
Qt Version: 5.12.3

ADDITIONAL INFORMATION
Comment 1 Albert Astals Cid 2019-08-06 22:36:00 UTC
We're going to need a file you have problems with and exact description of the annotations you make
Comment 2 tutonis 2019-08-07 06:00:51 UTC
Created attachment 121991 [details]
annotated pdf

Attached example pdf. There seems to be additional problem - the inline note is never shown in chrome pdf viewer (additional to the behavior I described before).

There should be visible 4 annotations, will list them in creation order:
1. Red marking of text - "meters for Open"
2. Inline note with text - "This is second annotation I made"
3. Pop up note
4. Green line
Comment 3 tutonis 2019-08-07 06:18:16 UTC
Created attachment 121992 [details]
Screenshot of pdf viewers

Added screenshots of few different pdf viewers
Comment 4 Albert Astals Cid 2019-08-07 18:22:26 UTC
Given that Adobe renders the file the same way Okular does https://i.imgur.com/6rtYu1Q.png

I wonder why you think this is an Okular bug and not an okular in firefox/chrome/foxit/zathura pdf viewer ?
Comment 5 tutonis 2019-08-07 19:53:59 UTC
I am not familiar with pdf standard but I do imagine the analogy to html should stand - user/program can craft non conformant html markup code and browsers choose to show it correctly or error out. In this situation there are multiple viewers showing different results - this does seem that annotations could be "crafted" better or that most pdf viewers are meh on standards. In that case is there any combination where annotation is shown correctly in all viewers?
Comment 6 Albert Astals Cid 2019-08-07 20:41:22 UTC
So you don't know if it's a bug.

Unless you can prove we're doing it wrong i'll say we're doing it right if Adobe Reader shows the things we create.
Comment 7 tutonis 2019-08-07 20:55:08 UTC
I do not understand how adobe reader is relevant here? Is it officially declared as gold standard? More over it is the only one of many viewers which shows 100% of annotations as okular. 

I do not have (right now) technical knowledge needed to debg this issue - my contribution was to document the issue and do testing or other non technical work.
Comment 8 Albert Astals Cid 2019-08-07 20:57:37 UTC
(In reply to tutonis from comment #7)
> Is it officially declared as gold standard? 

It's the implementation of the guys that wrote the spec, so kind of yes.

> I do not have (right now) technical knowledge needed to debg this issue - my contribution was to document the issue and do testing or other non technical work.

My suggestion is you attach that pdf to the bug trackers of the other pdf viewers and say "look, it works on Adobe Reader, so it should work for you too" and see what they say
Comment 9 Tobias Deiminger 2019-08-08 06:33:29 UTC
(In reply to Albert Astals Cid from comment #8)
> My suggestion is you attach that pdf to the bug trackers of the other pdf
> viewers and say "look, it works on Adobe Reader, so it should work for you
> too" and see what they say
They are aware, see below. Issue happens because the FreeText annotation in the attached PDF has no AP (appearance stream).

Firefox uses PDF.js, they have an issue with FreeText without AP: https://github.com/mozilla/pdf.js/issues/6810
Chrome uses PDFium, seems they have issue with FreeText in general: https://bugs.chromium.org/p/pdfium/issues/detail?id=569
Okular, Evince (and Zathura, depending on configuration) use poppler. Poppler displays correctly without AP, but can't store AP when saving the PDF.
Adobe displays (copes without AP) and writes (saves AP) correctly.

PDF 1.7 says AP is optional. I.e., readers must be able to display the annotation anyway.
PDF 2.0 says AP is mandatory. I.e., writers must be able to generate and save AP along with the annotation.

So no use in blaming some party, all could do better. Solving is just not that easy and needs an extra portion of spare (or sponsored) time. Now that PDF 2.0 has made AP mandatory, I believe duty has shifted somewhat to poppler side. 

I'd suggest to close this one and open an issue at poppler side?
Comment 10 Luigi Toscano 2019-08-08 07:41:09 UTC
It is true that poppler should add the AP when it creates a PDF 2.0 file. On the other hand, that does not solve the problem with documents which declares an older version of the PDF format, where the AP is not mandatory. In that case the viewers should still be fixed. 
The document that you attached is a PDF 1.4, for example.
Comment 11 Albert Astals Cid 2019-08-08 17:22:35 UTC
read Tobias' comment, clearly not a bug in Okular