We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi,
I'm working on a program that basically has to open a pdf, draw some shapes and save it. It isn't possible doing it with the built-in library because it is only for exporting. Searching around I found the PDFBox library that should be able to do those things and there is my dumb question:
How can I install this library in Processing? I put the .jar file downloaded from http://pdfbox.apache.org/download.cgi#recent into the libraries folder and I restarted Processing, but I can't see it in Sketch>Import Library...
Answers
I made it work adding the .jar as file in the sketch, but now I have another problem xD
I'm writing this simple but not working code just to see how the library works:
/======================================
import org.apache.pdfbox.pdmodel.*;
import java.io.File;
File f = new File("/Volumes/Jumpeter HDD/Dropbox/MONTAGGIO/PALAZZI/4.pdf");
PDDocument pdf = null;
void setup() {
size(600, 400);
//String s = "/Volumes/Jumpeter HDD/Dropbox/MONTAGGIO/PALAZZI/4.pdf";
pdf = PDDocument.load(f);
}
void draw() {
}
//======================================
It gives me this error: "Unhandled exeption type IOExeption" both if I load with the String or the File, WHY?
You have to handle the exception... FAQ: What is an exception? (and what are "unhandled exceptions")
Other useful reading: Processing forum rules and advices