Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Can't save PDF: "beginRaw()/endRaw() is not available with this renderer"

$
0
0
Hi, I searched in the forum for someone with the same problem, but with no sucess.

I need to save a frame in PDF from a animation, so I used the processing.PDF library. I writed my code based on the example of the reference of the library (http://processing.org/reference/libraries/pdf/). A part of the code:


  1. import processing.pdf.*;

  2. void setup(){
  3.   
  4. size(1600,900);
  5. background(255);
  6. noFill();
  7. smooth();
  8. record = false;
  9. px = width/2;
  10. py = height/2;
  11. logo = loadImage("logo.png");
  12. image(logo,width/2 - 250,height/2 - 50);

  13. }

  14. void draw(){
  15.   
  16.    if (record) {
  17.     beginRaw(PDF, "output.pdf");
  18.   }
  19.   if (record) {
  20.     endRaw();
  21.     record = false;
  22.   }


  23. void keyPressed(){
  24.  
  25.   if (key == 'r' || key == 'R') {
  26.     record = true;
  27.   }
  28.   
  29. }

When I press the key 'r' to save the PDF the program still run, but no file is saved. This message shows in the display:

beginRaw() is not available with this renderer
endRaw() is not available with this renderer

I've already used this sames functions to save PDFs files of animations, but using the P3D renderer. I tried to use in this code and the previous error was not displayed, but the file saved has no graphics saved, it's just a white PDF of 0kb. Besides, using P3D modifies the graphics that I'm trying to save, that are just a bunch of lines with a large stroke width.

I really need to save these PDFs for an illustration. Can someone help me? Thanks.



Viewing all articles
Browse latest Browse all 1768

Trending Articles