I am using iText for adding text to existing pdf file. It works for simple pdf but have problems with pdf with AcroForms.
My code:
PdfReader reader = new PdfReader("/Users/simple-user/Downloads/acroform.pdf");
PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(
"/Users/simple-user/Downloads/acroform2.pdf"));
BaseFont bf = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.CP1252,
BaseFont.NOT_EMBEDDED);
PdfContentByte over = stamper.getOverContent(1);
over.beginText();
over.setFontAndSize(bf, 10);
over.setTextMatrix(107, 107);
over.showText("page updated");
over.endText();
stamper.close();
Error message: "This document enabled extended features in Adobe Acrobat Reader DC. The document has been changed since it was created and use of extended features is no longer available. Please contact the author for the original version of this document."
and there is no text i wanted to add to file
Any ideas what I am missing?