hey! i got this code and i wanted to export a pdf but the problem is, when ever i open the PDF in acrobat it says that i the file has an error.
here's my code... am i doing something wrong in my export?
Code:import processing.pdf.*;
color[] mycolours = {
// color(215,161,44),color(11,17,3),color(32,75,8),color(86,138,20),color(56,108,12),color(247,94,43),color(150,105,17),color(44,45,9),color(236,59,25),color(246,130,49),color(114,59,13),color(97,100,25),color(146,133,23),color(127,160,40),color(173,70,16),color(203,90,27)};
color(190,193,208),color(133,55,21),color(50,79,139),color(28,17,70),color(103,136,181),color(211,137,71)};
String[] shapeNames = { "A.svg" , "B.svg"};
PShape[] shapes;
int num = 1;
void setup(){
//---------------------
size(800,600);
smooth();
background(255);
//_____________________________
shapes = new PShape[shapeNames.length];
for (int s = 0; s < shapes.length; s++)
shapes[s] = loadShape(shapeNames[s]);
//______________________________________
}
void draw(){
beginRecord(PDF, "grid_7_"+ num + ".pdf");
float rot=random(10);
//rotate(rot);
noStroke();
//translate(10,10);
for(int i = 0 ;i < 800; i = i+20){
for(int j = 0 ;j < 600; j= j+20){
PShape shapeToDraw = shapes[int(random(shapes.length))];
scale(random(3));
float trans = random(50,100);
shapeToDraw.disableStyle();
color cor2 = mycolours[int(random(mycolours.length))];
color cor = mycolours[int(random(mycolours.length))];
fill(cor2,trans);
//strokeWeight(random(4));
//stroke(cor);
float rnd = random(4);
shapeMode(CENTER);
float xprop = shapeToDraw.width*rnd;
float yprop = shapeToDraw.height*rnd;
shape(shapeToDraw,i,j, xprop,yprop);
// ellipse(i,j,10,10);
noLoop();
}
}
}
void mousePressed(){
// fill(255,100);
// rect(-1,-1,width+1,height+1);
background(255);
redraw();
}
void keyPressed(){
if(key=='s'){
endRecord();
num++;
}
}