[ 
https://issues.apache.org/jira/browse/PDFBOX-3393?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Maruan Sahyoun updated PDFBOX-3393:
-----------------------------------
    Fix Version/s: 2.1.0

> Javascript actions on form fields cause data to become hidden
> -------------------------------------------------------------
>
>                 Key: PDFBOX-3393
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3393
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: AcroForm
>    Affects Versions: 2.0.2
>            Reporter: Scott Coldwell
>             Fix For: 2.1.0
>
>         Attachments: SF3102.pdf
>
>
> We have run across numerous PDFs that contain javascript actions on some of 
> the form fields.  When trying to set a value for the field, the data is there 
> in the field, but only visible if you place the cursor in the field.  And 
> since we flatten forms before saving them, it looks as if the data was never 
> populated.  Some of the actions we've seen are like the following:
> AFDate_KeystrokeEx("mm/dd/yyyy")
> AFNumber_Keystroke(0, 0, 0, 0, "", true);
> As a workaround we are remove any actions associated with a field before 
> setting a value by doing the following:
> {code}
> final PDField field = form.getField(fieldName);
> if (field instanceof PDTerminalField)
> {
>     // Need to clear any actions (typically javascript) from the fields
>     ((PDTerminalField)field).setActions(null);
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to