[pdftex] Forms: entries have to be made visible

Marco Loskamp loskamp at math.wisc.edu
Thu Dec 2 08:28:50 CET 2004


Hi all,

I'm working on stuff almost the same as D.P. Story is working on,
namely PDF forms (AcroForms) with PDF level JavaScript, focused
on online quizzing and "interactive math documents". But I'm not
using PDFmarks---in fact I'm entirely working without an intermediate
postscript file, so just going from pdfTeX.

My problem is that many fields with default entries, /V (bla) or /DV (bla),
don't show their initial value at the time the document is loaded. Here's
some bad workaround, for which I'd like to have a better solution avoiding
the /OpenAction:

  \pdfcatalog{%
    /OpenAction <</S/JavaScript/JS(%
      for (var i = 0; i < this.getNumPages; i++)
      {
        var f = this.getField(this.getNthFieldName(i));
        f.value = f.value;  // this is the line that makes the value^^J
                            // actually show up.
      })>>
    }

And then I can implement a number of annotations (/Subtype/Widget /FT/Tx ...),
more precisely with commands like the following:

  \pdfannot height 1em depth 0.2em width 20em{%
    /Subtype/Widget
    /FT /Tx
    /T (FieldName)
    /V (Value)
    /DV (DefaultValue)
    }

without the f.value = f.value line in the /OpenAction in the /Catalog
(\pdfcatalog) JavaScript action, some annotations work, others don't.
And it appears to me that I can't even deterministically say under which
conditions they do/don't show up. It seems that the Linux 5.0.9 Reader
doesn't display, but the WindowsXP reader 6.0.1 does display, but the
Win reader only if explicitly done with the /OpenAction implemented
above.

I thank everyone in advance for their answer!

Marco Loskamp



More information about the pdftex mailing list