Could someone help me figure out how to upload to PDF? I draw a simple circle and export the result to PDF. When I open the file in a vector program, I see that two objects have been unloaded at the same place. One object is invisible because it has no outline. The second object with an outline. And both without filling, although in the code I used fill(0). How can I get rid of this double upload? When there are a lot of objects, and their number doubles in this way, this becomes a problem.
And the second question, can I set the file size when uploading to PDF? My default is always A4, and I would like to be able to change this, but I can’t find how.
import processing.pdf.*;
size(400, 400);
beginRecord(PDF, "test.pdf");
// Put code here between *begenRecord()* and *EndRecord()*
noStroke();
fill(0);
// And so on...
endRecord();
The code example you provided does not run; you need to have a fimeName which is a String such as “test.pdf”
Thank you for your answer. I understand that vector graphics is scaled, but if I need some special proportions it’s not convenient to use other program to change file’s format. Do you mean I need to use createGraphics for this? I’m gonna try, thank you!
My code runs. This example is simplified, of course I use full path name in this string. It’s not a problem. Problem there is in finishing file.