Closed redserpent7 closed 8 years ago
Hi
It seems JNA lib used with Ghost4J is not compliant with Java 8... I never tested it...
Or maybe this is the Ghostscript version. Which one do you use ?
Regards Gilles
Le 1 sept. 2015 à 16:38, redserpent7 notifications@github.com a écrit :
Hi,
I am facing an issue with Ghost4j. I am using JDK 1.8 and Ghost4J 1.0.0. I am getting the following exception when calling this code:
PDFDocument doc = new PDFDocument(); doc.load(new File(inFile)); SimpleRenderer renderer = new SimpleRenderer(); renderer.setResolution(300); List<Image> images = renderer.render(doc, 1, 1);
I get the following exception and trace:
Exception in thread "main" java.lang.AbstractMethodError: com.sun.jna.Structure.getFieldOrder()Ljava/util/List; at com.sun.jna.Structure.fieldOrder(Structure.java:884) at com.sun.jna.Structure.getFields(Structure.java:910) at com.sun.jna.Structure.deriveLayout(Structure.java:1058) at com.sun.jna.Structure.calculateSize(Structure.java:982) at com.sun.jna.Structure.calculateSize(Structure.java:949) at com.sun.jna.Structure.allocateMemory(Structure.java:375) at com.sun.jna.Structure.(Structure.java:184) at com.sun.jna.Structure.(Structure.java:172) at com.sun.jna.Structure.(Structure.java:159) at com.sun.jna.Structure.(Structure.java:151) at org.ghost4j.GhostscriptLibrary$display_callback_s.(GhostscriptLibrary.java:63) at org.ghost4j.Ghostscript.buildNativeDisplayCallback(Ghostscript.java:381) at org.ghost4j.Ghostscript.initialize(Ghostscript.java:336) at org.ghost4j.renderer.SimpleRenderer.run(SimpleRenderer.java:105) at org.ghost4j.renderer.AbstractRemoteRenderer.render(AbstractRemoteRenderer.java:86) at com.appstest.documentconverter.PDFManager.GetThumbPDF(PDFManager.java:75) at MapTest.TestDocConv(MapTest.java:43) at MapTest.main(MapTest.java:34)
— Reply to this email directly or view it on GitHub.
Well I tried using JDK 1.7 and 1.6 but that did not help. As I said, I'm using 64-bit Ghostscript 9.16 on Windows
Hi,
It seems to be related to a JNA error : http://stackoverflow.com/questions/13096741/jna-capturing-every-window-java-lang-abstractmethoderror
But I did not have time to investigate more...
Hi Gilles,
Latest JNA versions require that class extending Structure
must override abstract method getFieldOrder
. GhostscriptLibrary
class has two nested classes that extend Structure
.
Regards, Quan
Hi,
You are right, Ghost4J is not compliant with latests JNA releases.
If the file you joined a fix ?
In this case, could you issue a pull request instead ?
Certainly. There's something about GhostscriptTest. If I ran its test cases individually, they would pass. I tested with Ghostscript 9.16 on Windows 10. GS 9.18 would throw exceptions.
OK thank you for the PR, it is merged !
Hi Gilles, I seem to suffer from the same error. Do I understand correctly that you have merged the fix in 1.0.1-SNAPSHOT? Can you publish a release 1.0.1, so I can use the fixed version?
Best regards!
We certainly can use Release 1.0.1 with current JNA version.
Thank you.
Great work guys. We could use it in tess4j. Let's release this, what do you say?
Hi,
I am facing an issue with Ghost4j. I am using JDK 1.8 and Ghost4J 1.0.0. I am getting the following exception when calling this code:
I get the following exception and trace:
And if it helps, I'm running the code on Windows using Ghostscript (gsdll64.dll) v9.16