Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-5900

ClassCastException in AnnotationValidator

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.32, 3.0.3 PDFBox
    • 2.0.33, 3.0.4 PDFBox
    • Preflight
    • None

    Description

      RunningĀ 

       PreflightParser.validate(file).getErrorsList()

      on attached file yields

      Exception in thread "main" java.lang.ClassCastException: class org.apache.pdfbox.cos.COSDictionary cannot be cast to class org.apache.pdfbox.cos.COSStream (org.apache.pdfbox.cos.COSDictionary and org.apache.pdfbox.cos.COSStream are in unnamed module of loader 'app')
              at org.apache.pdfbox.preflight.annotation.AnnotationValidator.checkAP(AnnotationValidator.java:229)
              at org.apache.pdfbox.preflight.annotation.AnnotationValidator.validate(AnnotationValidator.java:322)
              at org.apache.pdfbox.preflight.annotation.WidgetAnnotationValidator.validate(WidgetAnnotationValidator.java:57)
              at org.apache.pdfbox.preflight.process.reflect.AnnotationValidationProcess.validate(AnnotationValidationProcess.java:59)
              at org.apache.pdfbox.preflight.utils.ContextHelper.callValidation(ContextHelper.java:102)
              at org.apache.pdfbox.preflight.utils.ContextHelper.validateElement(ContextHelper.java:60)
              at org.apache.pdfbox.preflight.process.AcroFormValidationProcess.validateField(AcroFormValidationProcess.java:165)
              at org.apache.pdfbox.preflight.process.AcroFormValidationProcess.exploreFields(AcroFormValidationProcess.java:106)
              at org.apache.pdfbox.preflight.process.AcroFormValidationProcess.validate(AcroFormValidationProcess.java:61)
              at org.apache.pdfbox.preflight.utils.ContextHelper.callValidation(ContextHelper.java:102)
              at org.apache.pdfbox.preflight.utils.ContextHelper.validateElement(ContextHelper.java:141)
              at org.apache.pdfbox.preflight.PreflightDocument.validate(PreflightDocument.java:139)
              at org.apache.pdfbox.preflight.parser.PreflightParser.validate(PreflightParser.java:865)
              at org.apache.pdfbox.preflight.Validator_A1b.runSimple(Validator_A1b.java:168)
              at org.apache.pdfbox.preflight.Validator_A1b.main(Validator_A1b.java:134)

      Attachments

        1. crash.pdf
          27 kB
          Fryderyk Tym

        Issue Links

          Activity

            People

              tilman Tilman Hausherr
              ftym Fryderyk Tym
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: