topical media & game development

talk show tell print

graphic-processing-learning-21-example-21-2-example-21-2.pde / pde



  // Learning Processing
  // Daniel Shiffman
  // http://www.learningprocessing.com
  
  // Example 21-2: PDF using beginRecord()
  
  import processing.pdf.*;
  
  void setup() {
    size(400, 400);
    
    // beginRecord() starts the process. 
    // The first argument should read PDF and the second is the filename
    beginRecord(PDF, "filename.pdf" ); 
  }
  
  void draw() {
    
    // Draw some stuff!
    smooth();
    background(100);
    fill(0);
    stroke(255);
    ellipse(width/2,height/2,160,160);
    
    // endRecord( ) is called to finish the PDF.
    endRecord();
   
   // There's no reason to loop any more since the PDF is finished. 
    noLoop(); 
  }
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.