====== Générer un PDF====== Générer un PDF de plusieurs pages à partir d'un PGraphics import processing.pdf.*; void setup() { size(400, 400); } void draw() { } void keyPressed() { int taillePDF = 10; PGraphics pdf = createGraphics(400, 400, PDF, "Fichier.pdf"); pdf.beginDraw(); for (int i = 0; i < taillePDF; i++) { pdf.background(128, 0, 0); pdf.text(i + 1, width / 2, height / 2); if (i < taillePDF - 1) { ((PGraphicsPDF) pdf).nextPage(); } } pdf.dispose(); pdf.endDraw(); println("Génération PDF terminée"); } {{tag>processing sylvain}}