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

Can render PDF with PDFRenderer but not with PageRenderer

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Bug
    • Affects Version/s: 2.0.20
    • Fix Version/s: None
    • Component/s: Rendering
    • Labels:
      None

      Description

      I get the following NPE when I try to renderer a PDF with the PageRenderer (See SimplePDFPageRenderer.java) but it works when I use PDFRenderer (See SimplePDFRenderer.java). The Exception is:

      Exception in thread "main" java.lang.NullPointerExceptionException in thread "main" java.lang.NullPointerException at org.apache.pdfbox.rendering.PageDrawer.isHiddenOCG(PageDrawer.java:1907) at org.apache.pdfbox.rendering.PageDrawer.beginMarkedContentSequence(PageDrawer.java:1876) at org.apache.pdfbox.contentstream.operator.markedcontent.BeginMarkedContentSequenceWithProperties.process(BeginMarkedContentSequenceWithProperties.java:52) at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:932) at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:510) at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:484) at org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:156) at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:271) at de.ikoffice.pdf.SimplePDFPageRenderer.main(SimplePDFPageRenderer.java:62)

      The PDF can be found at: https://www.ikoffice.de/temp/DaumeBriefpapierDefekt.pdf

        Attachments

        1. SimplePDFPageRenderer.java
          4 kB
          Daniel Migowski
        2. SimplePDFRenderer.java
          0.6 kB
          Daniel Migowski

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                dmigowski Daniel Migowski
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: