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

Re : simple IPimage to PDF doesn't work

$
0
0
You changed according to my first remark, not to my second one. All drawings on the PDF surface must be prefixed by the PDF PGraphics name.
  1. PImage img;
  2. import processing.pdf.*;
  3. PGraphicsPDF my_pdf;
  4. void setup(){
  5.   size(500, 375);
  6.   img = loadImage("15.jpg");
  7.   my_pdf = (PGraphicsPDF)createGraphics(500, 375, PDF, "img.pdf");
  8.   my_pdf.beginDraw();
  9.   my_pdf.image(img, 0, 0);
  10.   my_pdf.endDraw(); // stop and save pdf
  11.   my_pdf.dispose();
  12.   //exit();
  13. }
I also moved the dispose() out of the drawing section.
Untested code...

Viewing all articles
Browse latest Browse all 1768

Trending Articles