PRODOK Engineering


12 February 2007

One-Liner of the week: Randomly random

by Max Wyss
filed under:

Quite regularly, there is a question on the mailing lists about random numbers, mainly for a unique identifier for a document.

Such random numbers are indeed not a big problem to implement, because JavaScript has the Math Object (because it is part of the Core, it is not described in the Acrobat JavaScript documentation), which contains the Math.random() method.


28 January 2007

One-liner of the Week: Simple Time Calculation

by Max Wyss

Resently a member of the PlanetPDF forum asked about a way to calculate the time difference between two times indicated in a drop down menu. The times in the drop down menu represent quarter hours (0:00, 0:15, 0:30, 0:45, 1:00, etc.).

(Acrobat) JavaScript provides some extensive time (and date) related functionality in the Date object of the Core. However, using this object is sometimes a bit awkward, and requires some scripting: First, the time strings must be converted to a valid date object. Then, the subtraction is executed. And finally, the result is converted to the desired output string.

9 October 2006

Why "Optimizing for Fast Web View" is not optimal for PDF forms

by Max Wyss

It has been one of the “little secrets” of Acrobat since version 4, that loading a fillable form under the browser can take quite a long time, or that all of a sudden the form does not react for some time.


Syndicate content