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

simple IPimage to PDF doesn't work

$
0
0
Hi all,

I'm testing out a code snippet which is to be integrated into a big sketch. I just want to test the image quality of the image inside a pdf. It will later be combined with vector output. Here's the code:
  1. PImage img;
  2. import processing.pdf.*;
  3. PGraphicsPDF my_pdf;
  4. void setup(){
  5.   size(500, 375);
  6.   img = loadImage("15.jpg");
  7.   image(img, 0, 0);
  8.   my_pdf = (PGraphicsPDF)createGraphics(500, 375, PDF, "img.pdf");
  9.   my_pdf.beginDraw();
  10.   my_pdf.dispose();
  11.   my_pdf.endDraw(); // stop and save pdf
  12.   //exit();
  13. }
  14. void draw(){
  15. }
All I get is a blank pdf file...? Maybe I'm missing something basic here but the code works in another sketch. I also tried with the exit() activated.
I hope someone can help me go just get this image in a pdf. Thanks a lot in advance. Best, d


Viewing all articles
Browse latest Browse all 1768

Trending Articles