This is because there is no drawing operation between the beginRecord()
and endRecord()
functions.
This code works thought (without using PDF
in the size()
method) :
import processing.pdf.*;
void setup() {
size(400, 400);
noLoop();
beginRecord(PDF, "filename.pdf");
}
void draw() {
// Draw something good here
line(0, 0, width/2, height);
save("test.png");
endRecord();
}