Change some attributes of a form field


#1
Dear Sir,
We are evaluating PDF.Kit on behalf of one of our customers.
I am trying to change some attributes of a form field (in fact, flags, destination file for a submit button, etc.) but have not been able to find any method for doing this. (I can only see how the value of a field is changed.)
Can this be achieved using your PDF.Kit ?
Thanks in advance.
Nicolás Aldai
CITIUS Software
Microsoft Certified Partner

#2

Dear forever,

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.

Best regards.


#3

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.

Best regards.


#4

Hi,
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’

frm.ImportFdf (ms);



Thanks in advance,


#5

Dear jurgoiti,

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.

Best regards.


#6

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.
///

ACTION_NEW_URL,
///
/// Make a field read only.
///

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:
form.ImportFdf (ms);


What about you suggestions?