You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Allan Holmstrom <g-...@ida.liu.se> on 2011/03/18 12:14:19 UTC

Cannot get the PDFReader.java program to work.

Hi!

I have fixed the property installation.
Now the program starts and runs untill I try to open
a PDF file to the program. I get the following message
in the NetBeans IDE 6.9.1:

java.lang.RuntimeException: Uncompilable source code
        at org.apache.pdfbox.pdmodel.PDPage.getMediaBox(PDPage.java:262)
        at org.apache.pdfbox.pdmodel.PDPage.findMediaBox(PDPage.java:278)
        at
org.apache.pdfbox.pdfviewer.PDFPagePanel.setPage(PDFPagePanel.java:61)
        at
org.apache.pdfbox.pdfviewer.PageWrapper.displayPage(PageWrapper.java:68)
        at org.apache.pdfbox.PDFReader.showPage(PDFReader.java:298)
        at org.apache.pdfbox.PDFReader.openPDFFile(PDFReader.java:290)
        at
org.apache.pdfbox.PDFReader.openMenuItemActionPerformed(PDFReader.java:234
)
        at org.apache.pdfbox.PDFReader.access$100(PDFReader.java:45)
        at
org.apache.pdfbox.PDFReader$2.actionPerformed(PDFReader.java:121)
        at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
        at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:231
8)
        at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java
:387)
        at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
        at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
        at
javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:809)
        at
javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItem
UI.java:850)
        at
java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
        at java.awt.Component.processMouseEvent(Component.java:6267)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
        at java.awt.Component.processEvent(Component.java:6032)
        at java.awt.Container.processEvent(Container.java:2041)
        at java.awt.Component.dispatchEventImpl(Component.java:4630)
        at java.awt.Container.dispatchEventImpl(Container.java:2099)
        at java.awt.Component.dispatchEvent(Component.java:4460)
        at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
        at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
        at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
        at java.awt.Container.dispatchEventImpl(Container.java:2085)
        at java.awt.Window.dispatchEventImpl(Window.java:2478)
        at java.awt.Component.dispatchEvent(Component.java:4460)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.ja
va:269)
        at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:
184)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.ja
va:174)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

When I look at the code at PDPage.java and PDRectangle.java
I cannot see any problems.
Since I cannot se what the problem realy is it is very hard
to solve the problem. NetBeans doesn't complain for those files.

Some of the java files in PDFBox is marked red, which means that
they are not compiled. Perhaps I should try to reinstall PDFBox.

Thankfull for fast response since I am stuck and I need to
hit the deadline.

Regards

Allan Holmström

Re: Cannot get the PDFReader.java program to work.

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
That sounds like a project setup problem in your IDE. You're probably
missing some dependency and that's why PDFBox is not fully compiled. The
problem may not directly be in PDPage or PDRectangle. I'd look at the
red files and figure out what dependencies are missing to compile these
files.

On 18.03.2011 12:14:19 Allan Holmstrom wrote:
> Hi!
> 
> I have fixed the property installation.
> Now the program starts and runs untill I try to open
> a PDF file to the program. I get the following message
> in the NetBeans IDE 6.9.1:
> 
> java.lang.RuntimeException: Uncompilable source code
>         at org.apache.pdfbox.pdmodel.PDPage.getMediaBox(PDPage.java:262)
>         at org.apache.pdfbox.pdmodel.PDPage.findMediaBox(PDPage.java:278)
>         at
> org.apache.pdfbox.pdfviewer.PDFPagePanel.setPage(PDFPagePanel.java:61)
>         at
> org.apache.pdfbox.pdfviewer.PageWrapper.displayPage(PageWrapper.java:68)
>         at org.apache.pdfbox.PDFReader.showPage(PDFReader.java:298)
>         at org.apache.pdfbox.PDFReader.openPDFFile(PDFReader.java:290)
>         at
> org.apache.pdfbox.PDFReader.openMenuItemActionPerformed(PDFReader.java:234
> )
>         at org.apache.pdfbox.PDFReader.access$100(PDFReader.java:45)
>         at
> org.apache.pdfbox.PDFReader$2.actionPerformed(PDFReader.java:121)
>         at
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
>         at
> javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:231
> 8)
>         at
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java
> :387)
>         at
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
>         at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
>         at
> javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:809)
>         at
> javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItem
> UI.java:850)
>         at
> java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
>         at java.awt.Component.processMouseEvent(Component.java:6267)
>         at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
>         at java.awt.Component.processEvent(Component.java:6032)
>         at java.awt.Container.processEvent(Container.java:2041)
>         at java.awt.Component.dispatchEventImpl(Component.java:4630)
>         at java.awt.Container.dispatchEventImpl(Container.java:2099)
>         at java.awt.Component.dispatchEvent(Component.java:4460)
>         at
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
>         at
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
>         at
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
>         at java.awt.Container.dispatchEventImpl(Container.java:2085)
>         at java.awt.Window.dispatchEventImpl(Window.java:2478)
>         at java.awt.Component.dispatchEvent(Component.java:4460)
>         at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
>         at
> java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.ja
> va:269)
>         at
> java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:
> 184)
>         at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.ja
> va:174)
>         at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
>         at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
>         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
> 
> When I look at the code at PDPage.java and PDRectangle.java
> I cannot see any problems.
> Since I cannot se what the problem realy is it is very hard
> to solve the problem. NetBeans doesn't complain for those files.
> 
> Some of the java files in PDFBox is marked red, which means that
> they are not compiled. Perhaps I should try to reinstall PDFBox.
> 
> Thankfull for fast response since I am stuck and I need to
> hit the deadline.
> 
> Regards
> 
> Allan Holmström




Jeremias Maerki