Bug 211369 - Annotations done on Mac OS X in PDF files show up as colored boxes in okular
Summary: Annotations done on Mac OS X in PDF files show up as colored boxes in okular
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 0.9.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
: 238842 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-10-21 20:54 UTC by Stefan Pflueger
Modified: 2012-08-18 19:44 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.9.0


Attachments
Example PDF created using OOo, annotation added using Mac OS X PDF viewer (41.67 KB, application/pdf)
2009-10-21 20:56 UTC, Stefan Pflueger
Details
Patch: Display text in annotation box, fixes positioning issue (1.40 KB, patch)
2009-11-09 00:39 UTC, Stefan Pflueger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Pflueger 2009-10-21 20:54:54 UTC
Version:           0.9.2 (using KDE 4.3.2)
OS:                Linux
Installed from:    Archlinux Packages

Text boxes which are added using the annotation tool in the Mac OS X (Snow Leo) PDF viewer are not rendered correctly in okular. Okular seems to fill the whole box with the text color, the text cannot be read.

I reproduced this using:
* Okular Version 0.9.2 Using KDE 4.3.2 (KDE 4.3.2) (KDEmod) on an ArchLinux box
* Okular Version 0.9.1 Using KDE 4.3.1 on a Debian testing system

The PDF files are rendered as expected using:
* Acrobat Reader 9.1.3
* KPDF 0.5.9 on old KDE 3.5.10

See attachment for an example PDF file.
Comment 1 Stefan Pflueger 2009-10-21 20:56:37 UTC
Created attachment 37713 [details]
Example PDF created using OOo, annotation added using Mac OS X PDF viewer
Comment 2 Albert Astals Cid 2009-11-06 00:03:29 UTC
Yes, there is a mismatch between what okular thinks it's a Freetext annotation and what a FreeText annotation really is, that sucks and should be fixed if someone has time :-/
Comment 3 Stefan Pflueger 2009-11-09 00:39:03 UTC
Created attachment 38199 [details]
Patch: Display text in annotation box, fixes positioning issue

I attached a small patch which
1) Uses GuiUtils::contents( annotation ) to get the text, the AnnotWindow does the same. 
2) Fixes a positioning issue for freetext annotations: Box width/height for QFont.drawText are not scaled correctly, results in displaced/clipped text if zoomed in/out, particularly when using centered or right aligned text.

Anyway, PDF FreeText annotations are still far away from being displayed in the way it is specified.
Comment 4 niburu1 2011-03-02 01:49:25 UTC
There is a related issue when adding text boxes in Adobe Acrobat Pro. Okular renders the text, e.g. "font: 'Myriad Pro',sans-serif 12.0pt; text-align:left; color:#FF0000" instead of the actual text in the box.

What is interesting is that whatever is used to generate thumbnails in KDE (e.g. Dolphin's preview) renders text boxes created in Acrobat Pro just fine.
Comment 5 Günter Haus 2011-07-19 11:51:06 UTC
Any news on this? 

It is nearly impossible to use okular for professional tasks when annotations done by foreign applications do not render correctly. This cannot be hard to debug since those files render ok in most other linux pdf viewers.
Comment 6 Albert Astals Cid 2012-08-09 22:04:12 UTC
Fabio, master of annotations, can you have a look at this?
Comment 7 Fabio D'Urso 2012-08-09 22:36:16 UTC
With Poppler 0.20 and Okular 0.15 (ie from KDE 4.9) we now get the expected rendering, because we now let Poppler render the annotations, and Poppler uses the embedded appearance stream if it's present, like in this case.
Previously, Okular used to draw all annotations, no matter whether Poppler had already rendered them or not. Therefore Poppler correctly showed the annotation, but Okular repainted it, wrongly, on top.
Comment 8 Fabio D'Urso 2012-08-18 19:44:25 UTC
*** Bug 238842 has been marked as a duplicate of this bug. ***