We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › [SOLVED]--PDF Library and "Import Library" error
Page Index Toggle Pages: 1
[SOLVED]--PDF Library and "Import Library" error (Read 1494 times)
[SOLVED]--PDF Library and "Import Library" error
Feb 11th, 2010, 8:35am
 
Hi all,
I have a problem with PDF Library and I don't know if this is the right section on the forum to post about it.
I have Processing 1.0.9 and I cannot run examples from the PDF Library (the default one).

This is taken from "One Frame" default example:
/**
* One Frame.
*
* Saves one PDF with the contents of the display window.
* Because this example uses beginRecord, the image is shown
* on the display window and is saved to the file.  
*/


import processing.pdf.*;

size(600, 600);

beginRecord(PDF, "line.pdf");

background(255);
stroke(0, 20);
strokeWeight(20.0);
line(200, 0, 400, height);

endRecord();

////
if i run this code i have this error:
Exception in thread "Animation Thread" java.lang.RuntimeException: You need to use "Import Library" to add processing.pdf.PGraphicsPDF to your sketch.
     at processing.core.PApplet.makeGraphics(PApplet.java:1192)
     at processing.core.PApplet.createGraphics(PApplet.java:1085)
     at processing.core.PApplet.beginRecord(PApplet.java:6869)
     at OneFrame.setup(OneFrame.java:32)
     at processing.core.PApplet.handleDraw(PApplet.java:1402)
     at processing.core.PApplet.run(PApplet.java:1327)
     at java.lang.Thread.run(Thread.java:637)

To other people here in the class the example is working.
What could it be?
Thank you very much.
12dp
Re: PDF Library and "Import Library" error
Reply #1 - Feb 11th, 2010, 12:31pm
 
Perhaps re-install Processing?
Re: PDF Library and "Import Library" error
Reply #2 - Feb 12th, 2010, 1:23am
 
Thank for your answer,
I already tried but without success.
Re: PDF Library and "Import Library" error
Reply #3 - Feb 12th, 2010, 2:21am
 
Strange, since other students have it working.
What is your platform?
Do you use Java shipped with Processing?
Ensure you have itext.jar and pdf.jar files in <Processing install dir>/libraries/pdf/library
Re: PDF Library and "Import Library" error
Reply #4 - Feb 14th, 2010, 3:34am
 
With the help of Brendan, a smart technician of Culture Lab @Newcastle University, I solved the problem.
I just moved the pdf library folder from inside processing.app to my external libraries folder and this solved the problem.
I forgot to mention that my platform is Mac.
Thank you.
12dp
Page Index Toggle Pages: 1