I make a plugin for the application, on a ViewPart, a simple pdf viewing tool for converting to images. I chose ghost4j for conversion
org.ghost4j.document.PDFDocument document = new org.ghost4j.document.PDFDocument(); document.load(new File(sourceFile.getAbsolutePath())); org.ghost4j.renderer.SimpleRenderer renderer = new org.ghost4j.renderer.SimpleRenderer(); int dpi = 200; renderer.setResolution(dpi); List<Image> images = renderer.render(document); Mistake
java.lang.NoClassDefFoundError: org / ghost4j / document / Document
It appears as soon as I open my ViewPart. The problem is in the last line, without it the ViewPart opens without errors. Also, if I create a test project from the examples of ghost4j, then it works fine with the same code. The library added everything you need. In the classpath tried to add this jarnik, it did not help. I do not understand what the catch is.
org.ghost4j.document.Documentis marked as optional (so as not to inflate the size of the jarnica), which is why your build system does not pull it up automatically. After you explicitly declare it, everything should fall into place. - etkiorg.ghost4j.document.PDFDocument document = new org.ghost4j.document.PDFDocument(); document.load(new File(sourceFile.getAbsolutePath())); org.ghost4j.document.Document doc = document.extract(1, document.getPageCount()); System.out.println("Total files to be converted -> "+ document.getPageCount()); org.ghost4j.renderer.SimpleRenderer renderer = new org.ghost4j.renderer.SimpleRenderer(); int dpi = 200; renderer.setResolution(dpi); images = renderer.render(doc);org.ghost4j.document.PDFDocument document = new org.ghost4j.document.PDFDocument(); document.load(new File(sourceFile.getAbsolutePath())); org.ghost4j.document.Document doc = document.extract(1, document.getPageCount()); System.out.println("Total files to be converted -> "+ document.getPageCount()); org.ghost4j.renderer.SimpleRenderer renderer = new org.ghost4j.renderer.SimpleRenderer(); int dpi = 200; renderer.setResolution(dpi); images = renderer.render(doc);ViewPart launches - Dmitriyjava.lang.NoClassDefFoundError: org/ghost4j/document/PDFDocument- Dmitriy