PDF Display Issue

When trying to view a PDF in the PDF Viewer I saw this error:

JPeg2000 (/JPXDecode filter) not supported yet
Unable to get xobject named “Im0”
Exception in thread “AWT-EventQueue-2” com.ribs.pdf.PDFException: Error reading XObject
at com.ribs.pdf.PDFPageParser.parse(PDFPageParser.java:687)
at com.ribs.pdf.PDFPageParser.executeForm(PDFPageParser.java:1085)
at com.ribs.pdf.PDFPageParser.parse(PDFPageParser.java:684)
at com.ribs.pdf.PDFPageParser.parse(PDFPageParser.java:542)
at com.ribs.pdf.PDFPageParser.parsePage(PDFPageParser.java:56)
at com.ribs.pdf.PDFPage.parse(PDFPage.java:482)
at com.ribs.pdf.PDFPage.getImage(PDFPage.java:473)
at com.reportmill.graphics.RMPDFImageReader.getImage(RMPDFImageReader.java:74)
at com.reportmill.graphics.RMImageData.awt(RMImageData.java:418)
at com.reportmill.graphics.RMImageFill.awt(RMImageFill.java:602)
at com.reportmill.graphics.RMImageFill.paintShape(RMImageFill.java:362)
at com.reportmill.shape.RMShapePainter.paintShape(RMShapePainter.java:166)
at com.reportmill.shape.RMShapePainter.paintShape_super(RMShapePainter.java:145)
at com.reportmill.shape.RMShapePainter.paintShapeDeep(RMShapePainter.java:90)
at com.reportmill.shape.RMShapePainter.paintShapeDeep(RMShapePainter.java:98)
at com.reportmill.RMViewer.paintComponent(RMViewer.java:554)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JViewport.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at com.inductiveautomation.vision.api.client.components.model.AbstractVisionPanel.paintChildren(AbstractVisionPanel.java:250)
at javax.swing.JComponent.paint(Unknown Source)
at com.inductiveautomation.factorypmi.plugins.reporting.components.ReportBase.paint(ReportBase.java:188)
at javax.swing.JComponent.paintChildren(Unknown Source)
at com.inductiveautomation.vision.api.client.components.model.AbstractVisionPanel.paintChildren(AbstractVisionPanel.java:250)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JLayeredPane.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at com.inductiveautomation.ignition.designer.designable.DesignPanel$DesignableContainerLayer.paintChildren(DesignPanel.java:1183)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintToOffscreen(Unknown Source)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
at javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
at javax.swing.RepaintManager.paint(Unknown Source)
at javax.swing.JComponent._paintImmediately(Unknown Source)
at javax.swing.JComponent.paintImmediately(Unknown Source)
at javax.swing.RepaintManager$3.run(Unknown Source)
at javax.swing.RepaintManager$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.access$1100(Unknown Source)
at javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

This happened in Ignition 7.7.0 and 7.5.12

I have attached the PDF that cuased the error.
PDF-Sample.pdf (246 KB)

I would suggest using the PDF Viewer that is available from the Module Marketplace. It is free to use.

marketplace.inductiveautomation. … oduleId=48

I had issues trying to load your PDF as well, however it just wouldn’t load, I didn’t receive an error message. I would suggest using the module I suggested.

I tried the module as per your suggestion and it does open the PDF properly.

For my use case, the client exports a ticket to be signed. When the signed ticket returns they scan in it and save as PDF, then attach it to the invoice and print/save it.

To attach the invoice I readFileAsBytes(), save it in the database, then display it as the second page in the Report Viewer in an Image Placeholder.

In this case I am unable to use the PDF Viewer module so I’m not sure how to handle this.