Thanks for considering Aspose.Pdf.Kit.
Could you give me more details about your requirements? Thus we could support your requirements better in new version.
Mr. Nicolás Aldai,
Thanks for considering our products. Untill now we really don’t provide the funtions of changing attributes, because as you know, there are many kinds of fields, such as text, button, drop-down box, list box and check box. Each of them has different attributes from others. Acutally we have the ablilites to change their attributes case by case, but it still has some problems to form a uniform interface, so we didn’t public it. Can you describe your requirement in detail as to help us consider whether to add it to our next version? Thanks a lot.
Presently we are using Adobe FDFToolkit to change or fill form fields.
In fact we do need to change the reaonly attribute of a button field (Button Control) (we are doing it as follows).
fdfDoc.FDFSetFlags (“submit”, (short) FDFItem.FDFSetFf, 1); // Set read only
and change the SubmitFormAction of the same form control (as follows)
fdfDoc.FDFSetSubmitFormAction (“submit”, (short) FDFActionTrigger.FDFUp, strSubmit, 130, Type.Missing);
We have also tried to write the FDF file using the FDFToolkit and then merging the resulting FDF with its matching PDF but the ‘flags’ and the ‘action’ attributes for that button are missing.
MemoryStream ms = new MemoryStream (buff);
// FDF is written to a memory buffer - ‘buff’ - using FDFToolkit and then imported using ‘ImportFdf’
Thanks in advance,
What you want is to change the button field’s attribute.
We will study this requirement and design a new API to support in the next version.
After designing the API, we will ask for your suggestions according to your requirement.
Mr. Nicolás Aldai,
The new interface will be added like the following:
1)A enum to define some pre-defined attributes:
public enum FieldAttribute
/// For button filed to new url.
/// Make a field read only.
2)A function to set the attribute of the field of the pdf file.
Form.SetFieldAttribute(string fieldName, FieldAttribute attributeName, string AttributeValue);
3)The example is : there are a submit button field "submitButton" and a text field "name" in the pdf. We could
set the attribute of these fields like the following:
form.SetFieldAttribute(“submitButton”, FieldAttribute.ACTION_NEW_URL , “HTTP://WWW.ASPOSE.COM”);
form.SetFieldAttribute(“name”, FieldAttribute.READ_ONLY, null);
and at last merge the fdf with the pdf like this:
What about you suggestions?