Bug 401999 - Pictures inserted into PDF with other PDF Editor covered by stamp icon
Summary: Pictures inserted into PDF with other PDF Editor covered by stamp icon
Status: CONFIRMED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
: 432849 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-12-11 11:54 UTC by rubisco
Modified: 2021-02-12 14:10 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
farc-ep logo appears covered with stamp icon (60.63 KB, image/png)
2018-12-11 11:54 UTC, rubisco
Details
farc-ep logo covered with stamp (PDF) (592.18 KB, application/pdf)
2018-12-12 23:38 UTC, rubisco
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rubisco 2018-12-11 11:54:31 UTC
Created attachment 116857 [details]
farc-ep logo appears covered with stamp icon

SUMMARY
Images that had been pasted to a PDF with another PDF editor, e.g. Adobe Acrobat, appear in Okular covered with a stamp symbol. 

STEPS TO REPRODUCE
1. Open Acrobat 
2. Press h to select hand tool
3. Press ctrl+v to insert an image from the clipboard
4. save pdf and open in okular

OBSERVED RESULT
The image appears covered by a stamp icon and is thus unreadable. 

EXPECTED RESULT
Display the image as is, with no icon overlay.


SOFTWARE/OS VERSIONS
Windows: 10, 1803
Okular installed via Chocolatey: 1.6.70

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2018-12-11 18:45:20 UTC
Very interesting. So the PDF was edited using the Windows version of Okular? Any chance you could edit the PDF with a Linux version and see if the issue reproduces?
Comment 2 Albert Astals Cid 2018-12-12 23:04:16 UTC
Nate, no, he did not use Okular in Windows, he clearly mentions he used Adobe Acrobat.

rubisco, please attach a document with this problem..
Comment 3 Nate Graham 2018-12-12 23:11:06 UTC
Read again:

> SOFTWARE/OS VERSIONS
> Windows: 10, 1803
> Okular installed via Chocolatey: 1.6.70

Chocolatey is a 3rd-party Windows package manager, so apparently he is using Okular for Windows.
Comment 4 rubisco 2018-12-12 23:38:28 UTC
Created attachment 116885 [details]
farc-ep logo covered with stamp (PDF)
Comment 5 Albert Astals Cid 2018-12-16 22:49:05 UTC
(In reply to Nate Graham from comment #3)
> Read again:
> 
> > SOFTWARE/OS VERSIONS
> > Windows: 10, 1803
> > Okular installed via Chocolatey: 1.6.70
> 
> Chocolatey is a 3rd-party Windows package manager, so apparently he is using
> Okular for Windows.

Ah right, i thought you mentioned he had used Okular to add the stamp, my bad for not reading ^_^
Comment 6 Albert Astals Cid 2018-12-16 22:54:12 UTC
Thanks for the file rubisco
Comment 7 Tobias Deiminger 2018-12-19 08:34:56 UTC
Adobe Reader created a stamp annotation where /Name = #23clipboard. That's not any of the PDF standardized images, but it's portable anyway because Adobe Reader included a custom image representation along with the annotation inside the PDF. Our PDF renderer poppler took it and rendered the image, that's what you see in the background.

Now Okular handles stamp annotations special: Because we know poppler has problems with stamps (can't save custom images, can't render stamps without embedded appearance), there's Okular code to draw the stamp instead on top of the page. Okular uses the information #23clipboard from /Name to look up an image with that name, but of course there is none. That's what you see in the foreground.

An intermediate solution could be to bypass drawing a QPixmap in pagepainter.cpp if there was no image found by KIconLoader (use KIconLoader::MatchType::MatchExact and check for null pixmap or "unknown" pixmap). Will try to provide a patch.

The root cause however is that (in the case of PDF) all stamp handling should solely be done by poppler, but poppler can't do it yet, and it's not easy to implement. See also https://bugs.kde.org/show_bug.cgi?id=383651.
Comment 8 Albert Astals Cid 2018-12-19 21:22:37 UTC
(In reply to Tobias Deiminger from comment #7)
> Adobe Reader created a stamp annotation where /Name = #23clipboard. That's
> not any of the PDF standardized images, but it's portable anyway because
> Adobe Reader included a custom image representation along with the
> annotation inside the PDF. Our PDF renderer poppler took it and rendered the
> image, that's what you see in the background.
> 
> Now Okular handles stamp annotations special: Because we know poppler has
> problems with stamps (can't save custom images, can't render stamps without
> embedded appearance), there's Okular code to draw the stamp instead on top
> of the page. Okular uses the information #23clipboard from /Name to look up
> an image with that name, but of course there is none. That's what you see in
> the foreground.
> 
> An intermediate solution could be to bypass drawing a QPixmap in
> pagepainter.cpp if there was no image found by KIconLoader (use
> KIconLoader::MatchType::MatchExact and check for null pixmap or "unknown"
> pixmap). Will try to provide a patch.

Actually fixing this pdf "the right way" is not hard, we just need https://paste.kde.org/pk6wzgiqs in poppler and then a "backendPaintsStamp" or similar in the okular core annotation.

I was working on this but if you want to pick it up i'm more than happy if you move it forward
Comment 9 Luca Weiss 2020-07-17 09:56:00 UTC
I believe I'm seeing the same problem with a PDF document with Okular 1.10.3 on Arch Linux. Right clicking on the "stamp" shows "Stamp symbol: #clipboard".

Moving the stamp keeps the actual image underneath (making it possible to view it), but the image likes to just disappear completely when scrolling/zooming and the document has to be re-opened to view the image again.
Comment 10 David Hurka 2021-02-12 14:10:09 UTC
*** Bug 432849 has been marked as a duplicate of this bug. ***