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

NullPointerException at PDPageContentStream.setFont

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.8.3
    • 1.8.4, 2.0.0
    • PDModel
    • None

    Description

      Using pdfbox 1.8.3 I get a NullPointerException in PDPageContentStream.setFont (java.lang.NullPointerException at org.apache.pdfbox.pdmodel.edit.PDPageContentStream.setFont(PDPageContentStream.java:322).

      I create a new "PDPageContentStream" object with "resetContext = true". In the constructor of PDPageContentStream the variable "resources" gets initialized. As a result of "resetContext = true" PDPageContentStream::close is called. In the "close" method now "resources" gets null. A following call to "PDPageContentStream::setFont" fails because resources is null.

      Attachments

        Activity

          People

            lehmi Andreas Lehmkühler
            gerhardt Gerhard Temper
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: