export to PDF
in
Core Library Questions
•
2 years ago
Hi,
I'm trying to write a program that prints the final frame of the drawing to a PDF file. With this code I have here, all frames are stored. How can I change this?
Secondly, since I'm using PDF recording instead of createWriter, the Shift button types a fat B on my screen (not in the PDF though). Can I get this out?
I'm new to programming all together, so I hope someone can help me out with my questions and other tips are also welcome.
Thnx!
Charlotte
import processing.pdf.*;
PFont font;
String letters = "";
String a = "(beware to press ENTER in time)";
void setup() {
size(720, 480);
beginRecord(PDF, "typewriter.pdf");
font = createFont(PGraphicsPDF.listFonts()[2], 25);
textFont(font, 60);
smooth();
fill(250, 151, 3);
textSize(25);
}
void draw() {
background(100, 100, 100);
text(a, 300, 450);
text(letters, 5, 30);
}
void keyPressed() {
letters = letters + key;
if (key == '%') {
//beginRecord(PDF, "typewriter.pdf");
//put here it records a white screen
endRecord();
exit();
}
}
1