Hello there intrepid Processing community!
I have a question about creating multi-page PDFs in Processing:
I’ve tried to modify the code from the Java implementation with limited success. I’ve created an empty PDF file with the code below, and a mostly blank PDF by using size(400,400,PDF,‘output.pdf’)
add_library('pdf')
pdf = createGraphics(100, 100, PDF, 'simple.pdf')
pdf.beginDraw()
pdf.background(100)
for index in range(1,10):
pdf.beginDraw()
pdf.stroke(255)
pdf.line(5,5, index * .5, height-index)
pdf.endDraw()
pdf.nextPage()
I am able to create single page PDF files by declaring the PDF renderer in size(), but I want to create multi-page PDFs. I guess I’m not sure how to reference the pdf to call nextPage() if I don’t declare it explicitly like in this example.
Thanks for any insight you marvelous people might have!