GitHub user jasonmackin opened a pull request:

    https://github.com/apache/pdfbox/pull/15

    PDFAcroForm flatten() ClassCastException

    When trying to flatten a pdf, I was was receiving a ClassCastException.   
field.getWidgets() can return both PDTerminalField and PDNonTerminalField. The 
for loop casts it to a PDTerminalField.
    
    Added a simple if statement checking the instanceof to make sure it was a 
PDTerminalField before casting and it seems to have fixed the problem.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jasonmackin/pdfbox trunk

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/pdfbox/pull/15.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #15
    
----
commit 61d7af6ab56e4b30d21c9061e135f25799275199
Author: Jason Mackin <[email protected]>
Date:   2015-10-08T19:35:56Z

    Added an if statement to prevent ClassCastExceptions when
    field.getWidgets() is an instance of PDNonTerminalField.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to