Bug 382859 - Okular does not execute JavaScript of PDF forms
Summary: Okular does not execute JavaScript of PDF forms
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: PDF backend (show other bugs)
Version: 1.1.0
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2017-07-28 14:24 UTC by Uwe Stöhr
Modified: 2020-11-25 11:32 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Uwe Stöhr 2017-07-28 14:24:16 UTC
attachment 106922 [details] is a PDF form I created with the latest pdflatex. It fulfils the PDF form specification as is used as reference PDF for for the program LyX. The PDF looks and works fine using Adobe Reader under windows. Under Linux using Okular 1.1.3 there are several bugs. (attachment 106923 [details] is the TeX source code of the form.)

This report is about executing JavaScript:
- open the PDF and go to sec. 2.4 and there to the 2nd push button
- click the button.

result: nothing happens. The underlying JavaScript code is either not executed or Okular has overseen that the document contains JavaScript. Adobe Reader executes it correctly and shows the defined message about a fridge.
Since I cannot find a setting in the Okular preferences to block JavaScript I guess it is a bug.

If it is not a bug but a missing feature Okular should warn the user that he cannot completely use the form. Many PDF forms from e.g. federal administration use JavaScript for hits and explanations about the different form fields.
Comment 1 Albert Astals Cid 2017-07-28 22:43:24 UTC
What's the different between a bug and a missing feature?

Honestly this is probably easy to fix, but given your attitude (I guess your software never has bugs nor missing features) I don't feel very inclined to spend much time having a look at fixing it.
Comment 2 Uwe Stöhr 2017-07-29 13:45:45 UTC
> What's the different between a bug and a missing feature?

I know the difference. As I wrote, I looked in the Okular settings and could not find anything regarding JavaScript. I googled and read that Okular can execute JavaScript in PDF forms, therefore I reported it as bug not as enhancement.
Meanwhile you sent ma a YouTube link showing that it works in same cases but as it doesn't work for my case I think bug was the correct report.

However, you cannot expect from new users to make the right decision in reporting things.

> Honestly this is probably easy to fix, but given your attitude (I guess your software never has bugs nor missing features) I don't feel very inclined to spend much time having a look at fixing it.

I wonder that you the bug reports personally. I don't know you and you don't know me. I was just trying out Okular and reported all things I found so far. It makes me sad that your personal preference if you like a bug reporter or not is involved in the decision to fix a bug or not. I think what I reported affects many users out there so it should be in general worth it to fix it, independent that I reported the issue at first.
Comment 3 Nate Graham 2018-04-30 12:43:36 UTC
Was this fully resolved with https://cgit.kde.org/okular.git/commit/?id=cead2bbef3c2878dfb42173f9885e8ab8a23cd86 and https://cgit.kde.org/okular.git/commit/?id=d3a549ca258e04058fa04d2993e2926e7136f390, or only partially? If the latter, what still needs to be done?
Comment 4 Uwe Stöhr 2018-04-30 19:53:13 UTC
(In reply to Nate Graham from comment #3)
> Was this fully resolved with...

I just checked with Okular 18.04 and the problem persists. See my initial comment to reproduce the bug. The pus button executes JavaScript but the button is not clickable in Okular 18.04. On Adobe Reader i can click the button and the JavaScript is executed.
Comment 5 Nate Graham 2018-04-30 19:54:12 UTC
Thank you for confirming. Looks like there are some more Javascript use cases that we need to work on.
Comment 6 Uwe Stöhr 2020-11-25 11:32:29 UTC
The situation is now (Okular 1.11) better. Clicking the second push button in sec. 2.4 of the example PDF (attachment 106922 [details]), the JavaScript code is executed.

So I think the bug can be marked as fixed.