Loading...
Logo
Processing Forum
I am using Processing's PDF capability to produce a large, well, a huge image. Processing with PDF seems to be a fantastic combination.
 
The Processing code for setup() and draw() is generated by a Java program. All has gone well so far, but now when the generated code grew to 277,963 chars, I get this error message (and my project is ruined).  Anyone has an idea what to? Dear creators of Processing, couldn't you extend that limit in future versions?

Replies(2)

This is not a limit of Processing, this is a limit of Java itself, so nothing can be done for that.
Well, you can do something, actually: just move some code from draw() to separate functions. The limit is per function, not per class.
It is really a better practice anyway: it makes the code more modular, easier to maintain, to read.

I re-read your message. Do you mean you generate the .pde file? What is the advantage over using core.jar (and pdf.jar+itext.jar) directly from your Java program?
Breaking up the generate code can be more tricky. Perhaps you can look at the generated patterns and see if they can be factored out to some functions.
Thank you very much for your response, you make several valid points. I have already started to break my into separate functions - or, actually, I plan to go for classes.
 
The advantage I think is the marvellous capabilities offered by a) Processing language, and b) PDF print dialogue (my primary goal is to print those maps).
 
In Processing I can easily scale(), translate(), and rotate(). So far I have used hours of valuable (hobby) programming time in trying to write those methods myself.
 
The PDF print dialogue lets me divide the map into several sheets etc. Basically I am now in the POC (proof-of-concept) phase, and haven't really decided yet which way to go. Your suggestion on using Java directly to generate PDF is definitely worth considering.
 
Still, I think PDF offers some other benefits, over Java 2D API, so I think I am going to continue with that until proven otherwise, of course ;-)   But once again, thanks!