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

Re : simple IPimage to PDF doesn't work

$
0
0
Hi PhiLho,

Of course I modified my code according to what I believed was your comment. I tried the following:
  1. PImage img;
  2. import processing.pdf.*;
  3. PGraphicsPDF my_pdf;
  4. void setup(){
  5.   size(500, 375);
  6.   my_pdf = (PGraphicsPDF)createGraphics(500, 375, PDF, "img.pdf");
  7.   my_pdf.beginDraw();
  8.   img = loadImage("15.jpg");
  9.   image(img, 0, 0);
  10.   my_pdf.dispose();
  11.   my_pdf.endDraw(); // stop and save pdf
  12.   //exit();
  13. }
  14. void draw(){
  15. }
So I placed the writing of the image between the two draw methods. If this is not what you mean could you please correct the code so it does work? Thanks in advance for your time and help. Best, d.

Viewing all articles
Browse latest Browse all 1768

Trending Articles