Hi everyone
I want to print some things I have made in processing. For this, I need high dpi (It’s a lot of “line art” and fine details). It seems like the ideal image would be a lot larger than my screen could show in one. How would you go about getting processing.py graphics ready for printing?
I read this article here:
Sure enough, it’s for Java, but I thought it might work as a starting point. The place where I want to go for printing wants everything as a PDF, So I went with “Technique #2 - Generate a PDF”.
But I can’t get the PDF library to work. First, I was trying the library in my own code. Then, I was looking at example code in the reference. And the examples don’t work for me, either.
Here’s the example code, taken from beginRaw() \ Language (API)
add_library('pdf')
def setup():
size(400, 400)
beginRaw(PDF, "raw.pdf")
def draw():
line(pmouseX, pmouseY, mouseX, mouseY)
def keyPressed():
if key == ' ':
endRaw()
exit()
This gives me the following:
java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader ‘bootstrap’)
at jycessing.LibraryImporter.addJarToClassLoader(LibraryImporter.java:315)
at jycessing.LibraryImporter.recursivelyAddJarsToClasspath(LibraryImporter.java:164)
at jycessing.LibraryImporter.addLibrary(LibraryImporter.java:140)
at jycessing.LibraryImporter$1.call(LibraryImporter.java:82)
at org.python.core.PyObject.call(PyObject.java:480)
at org.python.core.PyObject.call(PyObject.java:484)
at org.python.pycode._pyx11.f$0(PDF_Test.pyde:1)
at org.python.pycode._pyx11.call_function(PDF_Test.pyde)
at org.python.core.PyTableCode.call(PyTableCode.java:171)
at org.python.core.PyCode.call(PyCode.java:18)
at org.python.core.Py.runCode(Py.java:1614)
at org.python.core.Py.exec(Py.java:1658)
at org.python.pycode._pyx10.f$0(C:/Users/LitMe/Documents/Processing/PDF_Test/PDF_Test.pyde:96)
at org.python.pycode._pyx10.call_function(C:/Users/LitMe/Documents/Processing/PDF_Test/PDF_Test.pyde)
at org.python.core.PyTableCode.call(PyTableCode.java:171)
at org.python.core.PyCode.call(PyCode.java:18)
at org.python.core.Py.runCode(Py.java:1614)
at org.python.core.Py.exec(Py.java:1658)
at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:276)
at jycessing.PAppletJythonDriver.processSketch(PAppletJythonDriver.java:233)
at jycessing.PAppletJythonDriver.findSketchMethods(PAppletJythonDriver.java:613)
at jycessing.Runner.runSketchBlocking(Runner.java:399)
at jycessing.mode.run.SketchRunner.lambda$2(SketchRunner.java:112)
at java.base/java.lang.Thread.run(Thread.java:833)
I have a rough understanding of what a Class Cast Exception is but I didn’t create the library. The PDF library works fine in Java mode for the Java examples. Can someone run the example code posted above? I don’t know if the problem is on my end, or if the example is broken.
I will try with Technique 1 from the linked webpage, too. But ideally, I’d like to get a PDF straight some processing.
So if you could help me with either getting the PDF library to function, or with me an alternative idea for creating high-resolution graphics ready for printing, then this would make my day.
cheers
EDIT:
Also, I can’t open any of the examples under Examples: Libraries>PDF Export. They immediately glitch out the Processing IDE for me.