How do I delete a submit button named 'Submit' from a form?
FormField submitBtn = document.getForm().getFields().getFormField("Submit");
boolean removeResult = document.getForm().getFields().remove(submitBtn);
The removeResult shows it was removed. However, when I render the document, the submit button still shows. FYI: the document is signed but the submit button is not included in the signature.
Deleting form fields
Re: Deleting form fields
Support · Aug 31, 2006Hello,
It is not possible to remove the any elements from an existing PDF document using our product. The remove method will remove the form field from the FormFieldList but not from the actual document.
However, there is a workaround which will allow you to either preserve all form fields or remove all form fields by flattening the form fields. You can find more details about the form flattening in the Help Documentation
on our web site.
Thanks,
ceTe Software Support Team