Discussion:
[iText-questions] questions about create new forms without create new document(eg:radio buttons .check button.and so on)
TTDET
2016-02-01 04:37:28 UTC
Permalink
i have already ready this chapters" Manipulating existing PDF documents", in the chapter tell me how creating text fields¡¢radio buttons check buttons ¡¢list and combo box and so on.But these demo need create new document;just as:
step1: Document document = new Document();
step2: PdfWriter writer =PdfWriter.getInstance(document, new FileOutputStream(filename));
stepn:writer..addAnnotation(radioGroup);(work fine)
:::::::::
i want to in existing pdf document,create new Forms. this is my code(when i create radio buttons ) :
step1:PdfReader pdfReader = new ITextPdfLoader(pdfSrc, getPassword()).getPdfReader();
step2:PdfStamper stamper = new PdfStamper(pdfReader, pdfOutStream);

step3:PdfWriter wirter =stamper.getWriter();
: : :
: : :
stepn:writer.addAnnotation(radioGroup);
in stepn,itext throw "unsupported.in.this.context.use.pdfstamper.addannotation"¡¢¡¢¡¢¡¢¡¢




Exception in thread "main" java.lang.RuntimeException: Unsupported in this context. Use PdfStamper.addAnnotation()




what should i do ,to solve this questions,it's ready hard,please help me ,thanks¡¢¡¢¡¢¡¢¡¢¡¢
iText mailing list
2016-02-01 08:33:00 UTC
Permalink
Post by TTDET
i have already ready this chapters" Manipulating existing PDF
documents", in the chapter tell me how creating text fields、radio
buttons check buttons 、list and combo box and so on.But these demo
step1: Document document = new Document();
step2: PdfWriter writer =PdfWriter.getInstance(document, new
FileOutputStream(filename));
stepn:writer..addAnnotation(radioGroup);(work fine)
i want to in existing pdf document,create new Forms. this is my
step1:PdfReader pdfReader = new ITextPdfLoader(pdfSrc,
getPassword()).getPdfReader();
step2:PdfStamper stamper = new PdfStamper(pdfReader, pdfOutStream);
step3:PdfWriter wirter =stamper.getWriter();
stepn:writer.addAnnotation(radioGroup);
in stepn,itext
throw "unsupported.in.this.context.use.pdfstamper.addannotation"、、、、、
This is answered on the official web site for developers:
http://developers.itextpdf.com/question/how-can-i-add-new-acroform-field-pdf
Loading...