I am populating an AcroFields form dynamically in a Java Servlet.
It's almost perfect.  The problem area is the
VISIBLE_BUT_DOES_NOT_PRINT option is lost in the process.  The
original pdf "template" has a PushbuttonField name "Edit".  What I am
doing is getting the "Edit" button and setting the url I want to
associate with the button so the user may edit the contents of the pdf
on a jsp page.  This works fine.  The problem is that the button
prints after I use the iText magic.  He is the code I am using.  The
form variable is the instance of AcroFields passed in to the method
that has the code below.

PushbuttonField pushbuttonField = form.getNewPushbuttonFromField("Edit");
PdfFormField editFormField = pushbuttonField.getField();
editFormField.setAction(PdfAction.createSubmitForm(
    request.getContextPath() + "/someurl",
    null,
    PdfAction.SUBMIT_HTML_FORMAT));
form.replacePushbuttonField("Edit", editFormField);

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to