Save multi pages PDF

#1

Hi,

I try to save a multi page PDF with ofBeginSaveScreenAsPDF(“file.pdf”,true) function.
I don’t use the ofApp::draw() function but just a loop for() to iterate all shapes what I want save.

I don’t find solution on the forum or with cairo :expressionless:

for (auto sh : shapes) {

    ofBeginSaveScreenAsPDF("/Users/Desktop/shapes.pdf",true);
    ofDrawRectangle(sh.position, sh.getWidth, sh.getHeight);
    ofEndSaveScreenAsPDF();
}

:v:

#2

What is the error you’re getting? Are you sure about the path? It seems wrong.