You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Andreas Lehmkühler (JIRA)" <ji...@apache.org> on 2017/03/25 18:10:45 UTC

[jira] [Updated] (PDFBOX-3393) Javascript actions on form fields cause data to become hidden

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

Andreas Lehmkühler updated PDFBOX-3393:
---------------------------------------
    Fix Version/s:     (was: 2.1.0)
                   3.0.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
>            Assignee: Maruan Sahyoun
>             Fix For: 3.0.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.15#6346)

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