Bug 424296 - Quick annotation action gets wrongly activated on protected pdf
Summary: Quick annotation action gets wrongly activated on protected pdf
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-16 17:44 UTC by Simone Gaiarin
Modified: 2020-07-23 21:32 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 1.11.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simone Gaiarin 2020-07-16 17:44:33 UTC
SUMMARY
When a pdf is protected PageView does not activate the annotation tools, so also "Quick Annotations" should be inactive all the time.

Actually this bug exposed me the fact that if the annotation tools are active, I can actually add annotations to a protected pdf, and save it. But apparently the annotations are not saved IN the pdf, but probably in an overlay managed by Okular, right? The point of disabling the annotations tools is to disable this behaviour?


STEPS TO REPRODUCE
1. Open a protected pdf (e.g. autotests/data/protected.pdf)
2. Select "Text Selection"

OBSERVED RESULT
"Quick annotation" gets activated


EXPECTED RESULT
"Quick annotation" remains deactivated

SOFTWARE/OS VERSIONS
Operating System: Manjaro Linux 
KDE Plasma Version: 5.18.5
KDE Frameworks Version: 5.70.0
Qt Version: 5.15.0
Kernel Version: 5.4.44-1-MANJARO
OS Type: 64-bit
Comment 1 Laura David Hurka 2020-07-16 18:49:00 UTC
AFAIK PDF protection is only a hypothetical thing. If you uncheck Configure Okular -> General -> Obey DRM limitations, annotation tools should be activated, and annotations are saved in the PDF as usual.

So yes, the annotation tools are only disabled to pretend that the PDF is protected.

What do you mean with “gets activated”? “I wanted to select text, but it gave me an annotation tool instead”? Or just that annotation actions become enabled?
Comment 2 Simone Gaiarin 2020-07-17 07:21:53 UTC
Sorry for the bad wording, Gets activated > become enabled.

See:
https://invent.kde.org/graphics/okular/-/merge_requests/221
Comment 3 Albert Astals Cid 2020-07-23 21:32:55 UTC
Git commit 558742a009f7e0ad810671f7b8e8388b620b90f1 by Albert Astals Cid, on behalf of Simone Gaiarin.
Committed on 23/07/2020 at 20:58.
Pushed by aacid into branch 'release/20.08'.

Ensure "Quick annotations" action is always disabled on protected pdf

If the annotations are disabled in the current pdf we can skip repopulating "Quick annotations" and in this way we also assure that the enabled/disabled state of the action is preserved upon configuration reparsing.

d->toolsEnabled must be initialized to true, in order to correctly populate the "Quick annotations" action the first time for non-protected pdf, given that setToolsEnabled is called after the first call to populateQuickAnnotations.
FIXED-IN: 1.11.0

M  +5    -0    ui/annotationactionhandler.cpp

https://invent.kde.org/graphics/okular/commit/558742a009f7e0ad810671f7b8e8388b620b90f1