I am having some issues with exporting to PDF using the sketch below. When I open the PDF, I should see 25 circles. I am greeted with a blank PDF. I feel like I am missing something rather obvious but it isn't coming to me.
import processing.pdf.*;
int wDim = 9; //dimension of width of printed paper
int hDim = 11; //dimension of height of printed paper
int res = 72; //Resolution of print in ppi
int cx = 0; //Center of circle - x coordinate
int cy = 0; //Center of circle - y coordinate
int sw = 0; //Strokeweight
int rd = 0; //Radius of circles
int h = 0; //Hue value
int s = 0; //Saturation value
int co = 0; //Counter
void setup() {
wDim = wDim * res; //Reset width of paper for ppi
hDim = hDim * res; //Reset height of paper for ppi
size(wDim, hDim, PDF, "c:/balloons.pdf"); //Set size of window
background(255); //Set background to white
stroke(0); //Set stroke to black
smooth(); //Turn on anti-aliasing
colorMode(HSB, 100); //Switch to HSB color mode
}
void draw() {
co = co + 1;
cx = int(random(wDim)); //Pick a random x for the circle center
cy = int(random(hDim)); //Pick a random y for the circle center
rd = int(random(10, 100)); //Select a random radius between 10 and 100
sw = int(random(1, rd/20)); //Select a random strokeweight between 1 and 5
strokeWeight(sw); //Set strokeweight
h = int(map(cx, 0, wDim, 0, 100)); //Convert cx into a hue value
s = int(map(cy, 0, hDim, 100, 0)); //Convert cy into a saturation value
fill(h, s, 100); //Set new fill value
stroke(h, 100-s, 100);
ellipse(cx, cy, rd, rd); //Construct circle
println(co);
if (co == 25){
println("finished");
exit();
}
}