Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
milazzi
milazzi's Profile
1
Posts
2
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
Multiple Pages PDF generation error
[2 Replies]
03-Mar-2012 11:16 PM
Forum:
Core Library Questions
I'm using Processing 1.5.1
The operating system is XP SP3
The hardware is a Sony Vaio VGN-FE21B
I tried this code, found at:
http://processing.org/reference/libraries/pdf/index.html
Multiple Pages (No Screen Display)
It's possible to write every frame as a new page in the PDF document. This example creates a 100 page document:
import processing.pdf.*;
void setup() {
size(400, 400, PDF, "filename.pdf");
}
void draw() { // Draw something good here
line(0, 0, frameCount * 4, height);
PGraphicsPDF pdf = (PGraphicsPDF) g; // Get the renderer
pdf.nextPage(); // Tell it to go to the next page
// When finished drawing, quit and save the file
if (frameCount == 100) {
exit();
}
}
and what I got has been a 101 (?) pages PDF (the last one blank).
«Prev
Next »
Moderate user : milazzi
Forum