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

NPE when parsing XMP schema definition with "closed Choice" value type

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.2, 1.8.9, 1.8.10
    • 1.8.10, 2.0.0
    • Preflight, XmpBox
    • None

    Description

      If PDF/A file includes custom metadata and its extension schema description containing the type "closed Choice of Text", PDF/A validation using Preflight fails with NPE. The extract from stack trace:
      java.lang.NullPointerException
      at org.apache.xmpbox.xml.PdfaExtensionHelper.populateSchemaMapping(PdfaExtensionHelper.java:214)
      at org.apache.xmpbox.xml.DomXmpParser.parse(DomXmpParser.java:193)
      at org.apache.xmpbox.xml.DomXmpParser.parse(DomXmpParser.java:106)
      at org.apache.pdfbox.preflight.process.MetadataValidationProcess.validate(MetadataValidationProcess.java:66)
      at org.apache.pdfbox.preflight.utils.ContextHelper.callValidation(ContextHelper.java:74)
      at org.apache.pdfbox.preflight.utils.ContextHelper.validateElement(ContextHelper.java:88)
      at org.apache.pdfbox.preflight.PreflightDocument.validate(PreflightDocument.java:168)
      ...

      It appears, that org.apache.xmpbox.xml.PdfaExtensionHelper#transformValueType() method does not consider "closed" or "open" directives for "Choice" value type in property definition.

      Attachments

        Activity

          People

            tilman Tilman Hausherr
            abyss Petras
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: