Friday, February 23, 2018

Okular gains some more JavaScript support

Andre Heinecke did some patches [1][2][3][4][5] over the last few weeks that finally got landed this week.

With it we support recalculation of some fields based on others. An example that calculates sum, average, product, minimum and maximum of three numbers can be found in this youtube video.

This code will be available for the Okular version that will ship with KDE Applications 18.04


Anonymous said...

Some more JavaScript support? That'd mean it already supported JS, however I could not find anything about it in the settings of Okular 1.2.3.
I hope there will be an option to deactivate JS completely as I actually don't see any reason to let a PDF execute any code, besides it increases the potential attack surface?

Kind Regards

Anonymous said...

Post-review of

- if ( cFunction === "AVG" )
+ if ( cFunction === "AVG" && cFields.length > 0 )
ret /= cFields.length;