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

COSString cannot be cast to COSDictionary

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.19
    • 2.0.20, 3.0.0 PDFBox
    • None
    • None

    Description

      We are using the latest version of PDFBox library 2.0.19. During the conversion of test file 1904.12320.pdf (which is a valid pdf file according to https://www.pdf-online.com/osa/validate.aspx) we get an error

      java.lang.ClassCastException: org.apache.pdfbox.cos.COSString cannot be cast to org.apache.pdfbox.cos.COSDictionary

       

      I am attaching also the stack trace:

       

      java.lang.ClassCastException: org.apache.pdfbox.cos.COSString cannot be cast to org.apache.pdfbox.cos.COSDictionary
       at org.apache.pdfbox.pdmodel.PDResources.getProperties(PDResources.java:353) ~[pdfbox-2.0.19.jar:2.0.19]
       at org.apache.pdfbox.rendering.PageDrawer.beginMarkedContentSequence(PageDrawer.java:1824) ~[pdfbox-2.0.19.jar:2.0.19]
       at org.apache.pdfbox.contentstream.operator.markedcontent.BeginMarkedContentSequenceWithProperties.process(BeginMarkedContentSequenceWithProperties.java:52) ~[pdfbox-2.0.19.jar:2.0.19]
       at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:875) ~[pdfbox-2.0.19.jar:2.0.19]
       at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:509) ~[pdfbox-2.0.19.jar:2.0.19]
       at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:483) ~[pdfbox-2.0.19.jar:2.0.19]
       at org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:156) ~[pdfbox-2.0.19.jar:2.0.19]
       at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:270) ~[pdfbox-2.0.19.jar:2.0.19]
       at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:321) ~[pdfbox-2.0.19.jar:2.0.19]
       at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:243) ~[pdfbox-2.0.19.jar:2.0.19]
       at org.apache.pdfbox.rendering.PDFRenderer.renderImageWithDPI(PDFRenderer.java:229) ~[pdfbox-2.0.19.jar:2.0.19]
      

       

       

      Attachments

        1. screenshot-1.png
          38 kB
          Tilman Hausherr
        2. 1904.12320.pdf
          1.50 MB
          Tomas Bene

        Activity

          People

            tilman Tilman Hausherr
            benetomas Tomas Bene
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: