Hello everyone,
I’m trying to export some graphics as a single screenshot to PDF.
The issue is that with my current code I am exporting a single frame of the window at a time (picture 1 below). I would like to export all of the graphics as one single vector file (picture 2 below).
Picture 1 - what I have :
Picture 2 - what I want :
Currently I’m following this tutorial from the oF book and my code looks like this :
I’ve added bool isSaving
to the header (.h) file.
In setup() and draw() :
void ofApp::setup(){
ofSetBackgroundAuto(false); // turns off automatic bg clearing
ofBackground(0);
isSaving = false;
}
void ofApp::draw(){
if (isSaving) {
ofBeginSaveScreenAsPDF("screenshot_"+ofGetTimestampString()+".pdf");
}
ofNoFill();
ofDrawEllipse(ofGetMouseX(), ofGetMouseY(), 20, 20);
if (isSaving) {
ofEndSaveScreenAsPDF();
isSaving = false;
}
}
And finally I’ve added an event listener :
void ofApp::keyPressed(int key){
if (key == 'c') {
isSaving = true;
}
My first thought was to switch on/off ofSetBackgroundAuto
to see if the background being redrawn or not had an effect on the output and it did not.
I’m a little lost, any ideas ?