How to export sketches with transparency for high-resolution printing?
in
Core Library Questions
•
2 years ago
Hi all,
I have a processing sketch that generates a different image every time a key is pressed. When it generates an image that I want to save, I would like to export the sketch for printing. What is the best way to do this? I have tried the following ways:
1. Export as PDF using the Processing library. This doesn't work because my sketch involves large numbers of PGraphics objects with transparent backgrounds, and the transparency doesn't seem to work on PDF output. It seems from looking at some older threads that PDF files might not support transparency anyway.
2. Export as SVG using a third-party library. I have not been able to get any third party library working. I have tried using this library:
but I get a NullPointerException, and I am reluctant to start digging through the code to figure out why it's not working.
3. Export as a PNG or JPEG at a higher resolution than the applet size. I don't know if it's possible to do this; my applet is running at 800x800 pixels, but in order to make large prints I would need at least 10 times this resolution, which obviously won't display properly on my monitor.
Does anybody have any suggestions? Obviously getting a working PDF or SVG exporter would be best since I can arbitrarily scale a vector graphics format. I'm sure that there are robust SVG export libraries available for Java - does anybody know how I can hook one of them up to Processing? I'm running my sketches from Java, not the Processing IDE.
1