I have just started using itext pdf in Java.
I have created pdf using itext in J2EE. It runs properly in Eclipse using Apache 5.5 server but after uploading the to live server, the pdf will not generate. I can't figure out what the problem is.
I have used itext-5.5.3 jars in my web application. My class is as follows:
public class create_pdf {
public String pdfcreate() throws FileNotFoundException {
try{
OutputStream file = new FileOutputStream(new File("C://Windows//temp//hello.pdf"));
Document document = new Document();
Font font = new Font(Font.FontFamily.COURIER, 8, 0, BaseColor.DARK_GRAY);
PdfWriter writer =PdfWriter.getInstance(document, file);
document.open();
document.add(new Paragraph("E-Ticket",fontheader));
document.add(new Paragraph("E-Ticket Generated On - "+new Date().toString(),font));
document.add(new Paragraph("hello",font));
document.close();
}
catch(Exception ex){
ex.printStackTrace();
}
return null;
}
}