[Tfug] Scripting PDF's

Bexley Hall bexley401 at yahoo.com
Tue Jul 9 19:20:26 MST 2013


Hi Robert,

On 7/9/2013 6:36 PM, Robert Hunter wrote:
> On Tue, Jul 9, 2013 at 2:14 PM, Bexley Hall <bexley401 at yahoo.com> wrote:
>
>> For instance, filling in an order form and having the PDF compute
>> the totals for each line item (QTY * piece price = item total).
>
> Don, since you want something interactive, you could make a case for using
> a web browser.   A little Javascript to do the processing, update the view,
> and then "print to PDF".

It's not that I want to *print* a particularly modified document
(e.g., the "order form" I mentioned).  Rather, I want the user to
be able to *explore* relationships that the document imposes
(i.e., implements).  For example, how the individual line items
on his potential order form contribute to his total cost...

What I'm trying to do is find a "document format" (e.g., PDF in
this case) that lets me create "active" documents that aren't
restricted to "static text and graphics".

For example, one of my speech synthesizer documents lets you
listen to speech samples (it's *really* hard to describe what
something *sounds* like -- much easier to just let people listen
to it!).  So, I can bundle the sounds *in* the document and
wrap words around *why* each sounds the way it does.

Or, point out how certain algorithms fail when confronting
certain types of data (e.g., salmon, phoenix, etc.) without
having to try to *describe* how these cases are (mis)pronounced.

While this is currently done with "pre-stored sound snippets",
I would like to modify it to allow the user to tweek parameters
for the synthesis and actually embed the synthesizer in the document
(so, you can explore different parameterizations and *hear* their
impact on the resulting speech).

In my immediate case, I want to allow "users" (readers) to explore
the consequences of various types of Bezier curves and the algorithms
that I present (e.g., "what does it cost to halve this parameter?").
So, I'd like the user to be able to interact with those curves
and see the results graphically.  E.g., how much harder is it to
compute the length of a curve having a high degree of curvature
than it is to compute the length of one that is "reasonably straight".

While I can do most of this with HTML, I can't control the
overall appearance of the documents as well as I can in a PDF.
And, I'm not sure I can bundle the document, multimedia files
(sound, graphic, etc.) *and* javascript that makes it all "run"
in a single file that can be fed directly into the "viewer".

[I'm looking for a single document format so the user doesn't
have to open a Mathematica notebook to view Topic A; an MSWord
document to view Topic B; etc.]

I want the documents to act like tutors so the user (reader) can
essentially query the document in much the same way it might
query a human instructor trying to present the same material.
So, they can explore their understanding with empirical examples
that *they* create (instead of relying on me creating every possible
case ahead of time in a static presentation)

(sigh)  Time for my "evening constitutional"  (cripes is it muggy!)

--don




More information about the tfug mailing list