My code follows
public static void main(String[] args) {
try
{
PdfReader reader = new PdfReader("D:\\SF_Users.pdf");
int n = reader.getNumberOfPages();
Rectangle psize = reader.getPageSize(1);
Document document = new Document(psize);
PdfWriter writer = PdfWriter.getInstance(document,
new FileOutputStream("D:\\new.pdf"));
document.open();
PdfContentByte pdf = writer.getDirectContent();
document.newPage();
PdfImportedPage page = writer.getImportedPage(reader, 1);
pdf.addTemplate(page, .5f, 0, 0, .5f, 60, 120);
document.close();
} catch (Exception de) {
}
}
Here i can able to read pdf while writting i want make it read only
Thank You