Bug 275371 - Stamp annotations are drawn by both poppler and Okular
Summary: Stamp annotations are drawn by both poppler and Okular
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 0.19.60
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords: usability
: 232058 352396 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-06-11 03:09 UTC by VJ777
Modified: 2022-03-17 09:47 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In: 21.12 with recent-ish Poppler
Sentry Crash Report:


Attachments
PDF file with markups (56.98 KB, application/pdf)
2011-06-11 03:13 UTC, VJ777
Details
Screenshot under 0.16 + Poppler 0.20 (34.98 KB, image/png)
2013-03-16 10:37 UTC, Fabio D'Urso
Details
Hidden rubber stamp (10.82 KB, application/pdf)
2015-01-29 22:16 UTC, Darren
Details

Note You need to log in before you can comment on or make changes to this bug.
Description VJ777 2011-06-11 03:09:35 UTC
Version:           0.10.5
OS:                Linux

Markup boxes containing text only show an empty box.  They do show up correctly with Gnome document viewer (Evince 2.30.3) and with adobe reader.
Markups were done with PDF-Xchange viewer under wine.

Running Okular 0.10.5 under Gnome (2.30.2) on Ubuntu (10.04).

Reproducible: Didn't try

Steps to Reproduce:
See attached file


Expected Results:  
A red text box with a line with an arrow pointing to "New pages coming up soon".  The box should contain the text "Check this".  Evince shows how this should appear.

OS: Linux (i686) release 2.6.32-32-generic
Compiler: cc
Comment 1 VJ777 2011-06-11 03:13:17 UTC
Created attachment 60874 [details]
PDF file with markups
Comment 2 Albert Astals Cid 2013-03-10 22:20:52 UTC
Fabio can you have a look? Almost everything looks right except the "Draft" thing that seems to be painted twice.
Comment 3 Fabio D'Urso 2013-03-16 10:37:08 UTC
Created attachment 78107 [details]
Screenshot under 0.16 + Poppler 0.20

(In reply to comment #0)
> Running Okular 0.10.5 under Gnome (2.30.2) on Ubuntu (10.04).
Okular 0.10 is "old" and we have changed how we handle PDF annotations in 0.15 (for best results you also need poppler >= 0.20).
I'm attaching a screenshot of how the document looks like now.

(In reply to comment #2)
> Fabio can you have a look? Almost everything looks right except the "Draft"
> thing that seems to be painted twice.
Yes, that's because Poppler has no support for drawing that kind of annotations (stamp) and thus Okular assumes that we have to draw it ourselves. But in this document the stamp annotation comes with an appearance stream, therefore Poppler *is* able to draw it. This is the reason why it is painted twice.
We could add a method in Poppler to query if the annotation comes with an appearance stream or not, and mark such annotations as ExternallyDrawn. What do you think?
Comment 4 Albert Astals Cid 2013-03-16 22:51:46 UTC
(In reply to comment #3)
> We could add a method in Poppler to query if the annotation comes with an
> appearance stream or not, and mark such annotations as ExternallyDrawn. What
> do you think?

I'd call it something like canIDrawMyself more than doIHaveAppearanceStream, but yeah, makes total sense
Comment 5 Albert Astals Cid 2014-05-11 13:51:29 UTC
*** Bug 232058 has been marked as a duplicate of this bug. ***
Comment 6 Darren 2015-01-29 22:14:39 UTC
I'm not sure whether this is exactly the same problem or not, but I have added another test file. It doesn't draw the stamp twice, it draws it once, then puts a ? graphic over the top of it.

This is using Okular .20.2 and libpoppler-glib8-0.26.5-1.1.i586 from OpenSuse 13.2.
Comment 7 Darren 2015-01-29 22:16:06 UTC
Created attachment 90800 [details]
Hidden rubber stamp
Comment 8 Christoph Feck 2015-09-23 16:43:56 UTC
*** Bug 352396 has been marked as a duplicate of this bug. ***
Comment 9 null 2017-11-26 23:05:03 UTC
Still a problem with Okular 17.11.80 and Poppler 0.61.

See also https://bugs.freedesktop.org/show_bug.cgi?id=23108 (Poppler should provide default appearance streams for annotations without).
Comment 10 Prajna Sariputra 2022-03-17 06:03:55 UTC
The stamps look fine to me on both the attached PDFs with Okular 21.12.3 and Poppler 22.03.0 (certainly doesn't look like the attached screenshot), so I guess it's fixed now?
Comment 11 Nate Graham 2022-03-17 09:47:47 UTC
Awesome!