pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Grosso <gary.gro...@oberontech.com>
Subject RE: PDFormFieldAdditionalActions.setC() not working?
Date Sun, 28 May 2017 18:04:20 GMT
I'm hoping someone has done calculations or other actions as the result of a textfield changing
and can share their experience with me.

Thanks,
Gary


-----Original Message-----
From: Gary Grosso [mailto:gary.grosso@oberontech.com] 
Sent: Friday, May 26, 2017 6:12 AM
To: users@pdfbox.apache.org
Subject: RE: PDFormFieldAdditionalActions.setC() not working?

In general, I can execute JavaScript from PDAnnotationAdditionalActions.setPO() to set the
current date as a field value, but I need to dynamically fill in some fields as the result
of a calculation using two or more other fields, and can't seem to do that. Perhaps I'm going
about it the wrong way? I can't seem to get anything at all to fire as the result of a text
field changing.

-----Original Message-----
From: Gary Grosso [mailto:gary.grosso@oberontech.com] 
Sent: Friday, May 26, 2017 12:19 AM
To: users@pdfbox.apache.org
Subject: PDFormFieldAdditionalActions.setC() not working?

In my project, I could not get setC to do anything, so I modified the CreateSimpleForm.java
code to create 2 fields (just in case that mattered), which resulted in http://aapro.net/PDF/SimpleForm.pdf.

Then I commented out a lot of distracting other event handling in FieldTriggers.java, and
duplicated everything to handle both fields, resulting in http://aapro.net/PDF/FieldTriggers.java
. This, when run gives http://aapro.net/PDF/FieldTriggers.pdf, which, in PDFDebugger looks
something like this:

AcroForm: (3) [3 0 R]
   DA: /Helv o Tfo g
   DR: (1) [70 R]
     Fields: (2)
       0: (12) [SOR] /T:Annot /S:Widget
       1: (11) [60R] /T:Annot /S:Widget
         AA: (2) [120 R]
             C: (3) [19 O R] /T:Action
                 JS: app.alert("On 'recalculate' action")
                 S: Javascript
                 Type: Action
             D: (3) [13 o R] /T:Action
                 JS: app.alert("On 'mouse down' action")
                 S: Javascript
                 Type: Action

Whatever I do, much as in my original project, I never see "On 'recalculate' action".

I get the expected (if somewhat annoying) behavior for setK, setF, and setV. Why not setC?

Thanks,
Gary



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message