PDF Export from a controlP5 sketch?

edited April 2014 in Library Questions


I would like to export a pdf from a drawing sketch that uses a controlP5 knob, but an error occurs.

The below code's error message is "Use createFont() instead of loadFont() when drawing text using the PDF library."

Would you suggest using an external window (ControlFrame) for the knob?

import processing.pdf.*;
import controlP5.*;

int knobValue = 100;
ControlP5 cp5;
Knob myknobValue;

void setup() {
  size(400, 400);

  beginRecord(PDF, "filename.pdf"); 

  cp5 = new ControlP5(this);
  myknobValue = cp5.addKnob("knobValue")
    .setRange(0, 100)
        .setPosition(20, 170)
                    .setColorBackground(color(0, 160, 100))
                      .setColorActive(color(255, 255, 0))

void draw() {
  line(mouseX, mouseY, mouseX, mouseY);

  if (keyPressed) {

Thanks in advance!

Sign In or Register to comment.