Hi ClojureVerse. I’m very fresh to FP, to Clojure, to Java, everything-- been through seom of Brave Clojure and 4Clojure so I have the basics down, but I’m stymied trying to put some of this to practical use.
Here’s my problem: clients submit photo-quality PDF scans, and we only need screen-quality, and the memory/bandwidth is getting expensive (and slow!). I need to reduce/compress these files.
I found that converting a pdf to ps and back with ghostscript reduces the file size by over 80-odd percent.
I also found a Java package Ghost4J that is a wrapper for Ghostscript. Yay! just import it and learn dot notation, right?
here’s the github repo: https://github.com/zippy1978/ghost4j
here’s the source page: http://www.ghost4j.org/
here’s the clojars page: https://clojars.org/net.sf/ghost4j
As far as I can tell, I’ve done everything to make sure my dependencies and imports are good. And my code compiles. However, when I try to run the ‘high-level api’ version of pdf to ps conversion as on the source page, I get
java.lang.NoClassDefFoundError: Could not initialize class org.ghost4j.GhostscriptLibrary
and a huge stacktrace. What are the steps I can take to ensure that I have, in fact, done everything I can? what is the big dumb obvious thing I’m missing? I went through the dependencies of the base class as well as GhostscriptLibrary, then walked through each import in core.clj to make sure the code compiles. Hit me with that facepalm, I’m ready for it.