[pdftex] define pdf variable and then reference it?

James Quirk jjq at galcit.caltech.edu
Thu Jun 1 17:22:06 CEST 2006


On Thu, 1 Jun 2006, Martin Schröder wrote:

> 2006/6/1, ivo welch <ivowel at gmail.com>:
>> not followed by anything.  (This brings me back to my original
>> definition: does pdf have an easy variable mechanism that can be
>> resolved at run time?  this would seem a lot easier than the FDF
>> multiple request route.)
>
> No.
With Acroread 7, there are two ways, maybe more, that can be used
to pass a variable to a PDF document:

(i)  You can add global variables to JavaScript's glob.setting.js file.
Under Linux, the relevant file is:

     ~/.adobe/Acrobat/7.0/JavaScripts/glob.settings.js

This approach has the disadvantage that the file must be written
before Acroread is launched.

(ii) You can construct a PDF on-the-fly that contains the information you 
wish to pass then the recipient-PDF opens this information-PDF, without 
displaying it, and grabs whatever variables it needs. For this approach to 
work the information-PDF must have its 'disclosed' property set.

Neither approach are particularly 'easy' to implement, but it is possible 
to hide the machinations from end-users by providing a wrapper to 
Acroread. For example, in an earlier thread, I mentioned I used such a 
wrapper (amrpdf) to account for Adobe's backwards incompatibilities.
Amrpdf also takes care of passing data in and out of the PDF's I generate.
Of course, the weakness of using a custom wrapper is that it cuts
down on the portability of the document.

Looking to the future, has anyone got any hard facts on Adobe's upcoming 
product "Apollo"? From the little I've gleaned it sounds like Apollo could 
act as a front-end for desktop applications, and so I would imagine that 
it provides hooks to get data in and out of PDF's.

James


More information about the pdftex mailing list