Bug 271728 - Okular does not calculate in PDF forms
Summary: Okular does not calculate in PDF forms
Status: CONFIRMED
Alias: None
Product: okular
Classification: Applications
Component: PDF backend (show other bugs)
Version: 0.19.60
Platform: openSUSE Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: houriehmk
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2011-04-25 23:48 UTC by Johannes Obermayr
Modified: 2025-02-04 11:18 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
The file as I had it saved on my HD (2.18 MB, application/pdf)
2017-07-28 21:12 UTC, Albert Astals Cid
Details
testcase calculate sums in forms (562.35 KB, application/pdf)
2025-01-28 08:21 UTC, Ronald
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Obermayr 2011-04-25 23:48:41 UTC
Version:           unspecified (using Devel) 
OS:                Linux

1. Download this PDF file:
    http://www.lff.bayern.de/download/formularcenter/beihilfe/c2740198-361d-46a7-a0b6-9873761ca878.pdf

2. Go to page 3

3. Type in some values in last column

4. The last row/column (bottom right) should be calculated ...

Reproducible: Always
Comment 1 Albert Astals Cid 2014-05-11 13:04:18 UTC
The file is sadly not available anymore, do you know where it is located now?
Comment 2 Yuri Chornoivan 2014-05-11 13:12:44 UTC
(In reply to comment #1)
> The file is sadly not available anymore, do you know where it is located now?

http://www.lff.bayern.de/download/formularcenter/beihilfe/beihilfeantrag.pdf
Comment 3 Albert Astals Cid 2014-05-11 13:45:56 UTC
Thanks Yuri :)
Comment 4 Uwe Stöhr 2017-07-28 14:27:40 UTC
> http://www.lff.bayern.de/download/formularcenter/beihilfe/beihilfeantrag.pdf

This file is no longer available.

I think that the bug still exists in Okular 1.1.3 because PDF form support seems to be in general broken: wrong display of the elements, no JavaScript, resetting of the form fields does not work ...
Comment 5 Albert Astals Cid 2017-07-28 21:12:48 UTC
Created attachment 106931 [details]
The file as I had it saved on my HD
Comment 6 Albert Astals Cid 2017-07-28 21:14:04 UTC
(In reply to Uwe Stöhr from comment #4)
> > http://www.lff.bayern.de/download/formularcenter/beihilfe/beihilfeantrag.pdf
> 
> This file is no longer available.
> 
> I think that the bug still exists in Okular 1.1.3 because PDF form support
> seems to be in general broken: wrong display of the elements, no JavaScript,

Please stop spreading wrong news, JavaScript works fine at least for some cases https://www.youtube.com/watch?v=S-zmHc3WUhs

> resetting of the form fields does not work ...
Comment 7 Uwe Stöhr 2017-07-28 21:53:36 UTC
> The file as I had it saved on my HD

Thank you. However, the bug still exists in Okular 1.1.3 for me: no calculation is performed.
Comment 8 Uwe Stöhr 2017-07-28 21:55:55 UTC
> Please stop spreading wrong news, JavaScript works fine

I don't spread wrong this, JavaScript does not work for me and therefore I reported it today as bug: https://bugs.kde.org/show_bug.cgi?id=382859

If you have a PDF in which JavaScript works, please attach there that I could have a look why it doesn't work for me.
Comment 9 Andre Heinecke 2018-01-24 12:31:52 UTC
While working on
https://phabricator.kde.org/T7805

I also looked at the file here it seems to do something to calculate the last sum that is not handled by poppler. If I use popplers/util/pdfinfo -js I don't get the JavaScript returned that contains the calculate call. So Okular does not even evaluate it.

Using pdfextract from the origami-pdf package i can extract the JavaScript though and it uses AFSimple_Calculate. But I don't see where the JavaScript is added. It does not appear to be in a calculate action, otherwise poppler would extract it. Also if I try to edit the PDF in Adobe Acrobat Pro it tells me that the document uses "advanced features" which are not supported by Acrobat Pro.


So as far as I understand it, while above mentioned Task would fix the calculation in theory, it does not fix this issue as the JavaScript for the calculation is injected in a way that poppler / okular don't extract. Yet.
Comment 10 Ronald 2025-01-28 08:21:49 UTC
Created attachment 177748 [details]
testcase calculate sums in forms

Here is an other testcase to demonstrate issue 271728 "Okular does not calculate in PDF forms"
The sums (marked in yellow) are calculated in Foxit and Adobe. Not so in Okular.