I have a next issue with itextpdf.
private void generatePdf() throws Exception {
FileOutputStream fos = null;
try {
PdfReader reader = new PdfReader("template.pdf");
fos = new FileOutputStream("test.pdf");
PdfStamper stamper = new PdfStamper(reader, fos);
stamper.close();
} catch (Exception e) {
throw e;
} finally {
if (fos != null) {
try {
fos.close();
} catch (IOException e) {
throw new Exception(e);
}
}
}
}
This method have to read a template and save that to a new pdf. But if I looked into a result pdf I just see blank pages (4 - the same amount as a template has). What interesting that this method is invoked in a context of web app on jboss server. But when I invoke this method like main method in simple java application (Class with main() method) it works fine. Also what can I add that the template has editable fields that have to be filled in future but nothing edits now. Can anybody assume what can be wrong here?
Best Regards, Sergey