GrtGaragesRUs
New Member
I am trying to open a PDF when the user selects "help" from within my java application. I read around google and felt ICEPDF might be the best solution. I have imported icepdfcore and icepdfviewer.jar in to my build path in eclipse and was trying the following code to launch the pdf:\[code\] public void helpview() throws URISyntaxException { String filepath = "/nullpdf.pdf"; // build a controller SwingController controller = new SwingController(); // Build a SwingViewFactory configured with the controller SwingViewBuilder factory = new SwingViewBuilder(controller); JPanel viewerComponentPanel = factory.buildViewerPanel(); // add copy keyboard command ComponentKeyBinding.install(controller, viewerComponentPanel); // add interactive mouse link annotation support via callback controller.getDocumentViewController().setAnnotationCallback( new org.icepdf.ri.common.MyAnnotationCallback( controller.getDocumentViewController())); // Use the factory to build a JPanel that is pre-configured //with a complete, active Viewer UI.// Create a JFrame to display the panel in JFrame window = new JFrame("Metrics Wizard Help"); window.getContentPane().add(viewerComponentPanel); window.pack(); window.setVisible(true);// Open a PDF document to view controller.openDocument(filepath); } }\[/code\]When I run the code I get the following console error:\[code\]Exception in thread "main" java.lang.NoSuchMethodError: main\[/code\]I am new to Java and have no idea what I have done wrong, any help well received.I would also like to point the PDF to a document contained within the JAR without extracting it if possible, I tried a getResource but didn't have any luck getting it to work. I think that is separate to the ICEPDF issue though.Andy