</head> <body> <% Document docume" name="description">

<%@page import="com.itextpdf.text.,com.itextpdf.text.pdf.,java.io.*;"%>
</head>
<body>
<%
Document document=new Document();
try{
PdfWriter.getInstance(document,new FileOutputStream("reporttest1.pdf"));
document.open();
document.add(new Paragraph("this is to test"));
}catch(Exception e){}
finally{ document.close();}
%>
</body>
I am using netbeans.I want to generate the pdf file from jsp page.I add the itext.jar to the libraries in net beans.I followed the above code.It's comlpiling with out errors.but i am not getting the pdf file.Any one please help me asap.Its very important and urgent in my project.

Save the generated file into C drive so that you can find it easily. Here is another example that will generate a pdf file into c drive and display message on it.
<%@page import="java.io.*"%>
<%@page import="com.lowagie.text.*"%>
<%@page import="com.lowagie.text.pdf.*"%>
<%
try {
Document document=new Document();
PdfWriter.getInstance(document,new FileOutputStream("C:/hello.pdf"));
document.open();
document.add(new Paragraph("Hello PDF"));
document.close();
}
catch (Exception e2) {
System.out.println(e2.getMessage());
}
%>
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.