We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
multipage pdf (Read 637 times)
multipage pdf
Mar 28th, 2009, 10:57am
 
Hi,
Is it possible to create a multi page pdf document? I want to create a pdf document with say, 20 pages. I first create a very long string that I want to spread over enough normal printable pages. I've now created a thousant word string but only 600 are printed on one pdf page. Is there a way to create new pages for the pdf?

Thank you very much for your help and time.
Regards, Danielle.
Re: multipage pdf
Reply #1 - Mar 28th, 2009, 4:02pm
 
Code:

import processing.pdf.*;

PGraphicsPDF pdf;

void setup()
{
size(200,200);
pdf = (PGraphicsPDF)createGraphics(width, height, PDF, "test.pdf");
beginRecord(pdf);
}

void draw()
{
background(0);
stroke(255);
line(random(width),random(height),random(width),random(height));
if(frameCount==5)
{
endRecord();
exit();
}
pdf.nextPage();
}


Page Index Toggle Pages: 1