[
https://issues.apache.org/jira/browse/PDFBOX-2486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14215338#comment-14215338
]
Tilman Hausherr edited comment on PDFBOX-2486 at 11/18/14 7:24 AM:
-------------------------------------------------------------------
Proposed patch. My thought:
- Both PDField and PDNonTerminalField are of the type PDFieldTreeNode
- The hierarchy property thing isn't really relevant here, because we just need
to know if any field has something "forbidden"
Weird stuff: checking the file 006654.pdf with pdf-tools brings "The document
contains actions types other than for navigation (Launch, JavaScript,
ResetForm, etc.)." among many other errors. Where are these action types? My
understanding is that these are /A and /AA and they're not at any field in this
file.
was (Author: tilman):
Proposed patch. My thought:
- Both PDField and PDNonTerminalField are of the type PDFieldTreeNode
- The hierarchy property thing isn't really relevant here, because we just need
to know if any field has something "forbidden"
Weird stuff: checking the file 006654.pdf with pdf-tools brings "The document
contains actions types other than for navigation (Launch, JavaScript,
ResetForm, etc.)." among many other errors. Where are these action types? My
understanding is that these are /A and /AA.
> ClassCastException in AcroFormValidationProcess.exploreFields
> -------------------------------------------------------------
>
> Key: PDFBOX-2486
> URL: https://issues.apache.org/jira/browse/PDFBOX-2486
> Project: PDFBox
> Issue Type: Bug
> Components: AcroForm, Preflight
> Affects Versions: 2.0.0
> Reporter: Tilman Hausherr
> Attachments: 004324.pdf, 006654.pdf, 006982.pdf, PDFBOX-2486.patch
>
>
> I get this with the attached files:
> {code}
> Exception in thread "main" java.lang.ClassCastException:
> org.apache.pdfbox.pdmodel.interactive.form.PDNonTerminalField cannot be cast
> to org.apache.pdfbox.pdmodel.interactive.form.PDField
> at
> org.apache.pdfbox.preflight.process.AcroFormValidationProcess.exploreFields(AcroFormValidationProcess.java:107)
> at
> org.apache.pdfbox.preflight.process.AcroFormValidationProcess.validate(AcroFormValidationProcess.java:60)
> at
> org.apache.pdfbox.preflight.utils.ContextHelper.callValidation(ContextHelper.java:73)
> at
> org.apache.pdfbox.preflight.utils.ContextHelper.validateElement(ContextHelper.java:88)
> at
> org.apache.pdfbox.preflight.PreflightDocument.validate(PreflightDocument.java:168)
> at
> org.apache.pdfbox.preflight.Validator_A1b.runSimple(Validator_A1b.java:161)
> at
> org.apache.pdfbox.preflight.Validator_A1b.main(Validator_A1b.java:126)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)