At a certain moment in my program I’m creating a pdf File with iText. This File is created so people can see it an also added to my database. It works just fine in Eclipse but when I make a runnable jar it doesn’t work. The file is not created and not added to the database. I have no idea why it’s not working in a jar.
PdfWriter writer = PdfWriter.getInstance(document,
new FileOutputStream(documentName.getName() + ".pdf"));
///////
File file = new File(document.getName() + ".pdf");
Any suggestions anyone? thx all
Just try to do this:
and check whether file exists on c drive as some_file. I believe it will. Additionally, I do not know what kind of object is document, but maybe it contains method that returns absolute path.
Edit:
If you use that file again in one program I would do this different:
or even