We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Changing submit buttons URL and format

Hi,

I am currently trying to change the submit URL and format of all submit buttons in a PDF form, using the FormEditor class. I've found the SetSubmitUrl method, which allows to change the URL of a submit button, however it requires the fieldname of the submit button and I haven't found any method to obtain the fieldname for all submit buttons in my form. I also haven't found any method to change the submit format for an existing submit button.

How can I obtain the fieldnames of all submit buttons in a form, and also how can I change their submit format.

Thanks in advance for your help.

Nicolas Venne
SIGMA-RH Solutions inc.

Hi Nicolas,

You can get all the field names using Form.FieldsNames property. As far as the submit format of a submit button is concerned, are you talking about you submit form flag? If so, please try FormEditor.SubmitFlag property. For list of the options, please have a look at SubmitFormFlag enumeration. Following article can also be helpful to you: Posting Acroform data on an external web page.

I hope this helps. If you find any more questions, please do let us know.
Regards,



Hi,

I am aware that the Form.FiedsNames property exists, however, I don’t see how I can know which ones are submit buttons in that list.

Yes, for the submit format I am talking about what you expose as the SubmitFlag. However, the FormEditor.SubmitFlag property doesn’t allow me to change the value for an existing submit button. I have to change that value for submit buttons that are already existing in my form (which where added with Acrobat) , not for new ones.

Thanks for your help,

Nicolas Venne
SIGMA-RH Solutions inc.

Hi Nicolas,

I’m sorry, currently Aspose.Pdf.Kit doesn’t provide any functionality to locate the submit buttons only in a PDF. However, I have logged this requirement as
PDFKITNET-10802 in our issue tracking system. We’ll update you once we implement this feature.

Regarding the SubmitFormFlag issue, yes, I have reproduced that at my end too and logged it as
PDFKITNET-10797 in our issue tracking system. Our team will be looking into the matter and you’ll be updated via this forum as the issue is resolved.

We’re sorry for the inconvenience.
Regards,



Hi Nicolas,

I would like to update you regarding issue logged as PDFKITNET-10802. In order to locate submit buttons only you can use the GetFieldType method. In fact, for that matter, you’ll have to combine FieldsNames property and GetFieldType. You can use the code snippet below to get the submit field names.


//create Form object

Aspose.Pdf.Kit.Form f = new Aspose.Pdf.Kit.Form(“input.pdf”);

//get names of all the fields in the PDF

string[] fields = f.FieldsNames;

string submitField = null;

//loop through all the fields

foreach (string s in fields)

{

//find out if FieldType is PushButton

if (f.GetFieldType(s) == FieldType.PushButton)

{

//if so, save the name of the submit field

submitField = s;


}

}


I hope this resolves your issue. If still find any questions or concerns, please do let us know.
Regards,

Hi Shahzad,

I already know that the Form.GetFieldType method allow to get the type of a field, however this will only allow me to get the list of all push buttons on my form, including for example reset buttons, not only the submit buttons of the form.

I would still need a way to know which buttons of that list are submit buttons.

Thanks for your help,

Nicolas Venne
SIGMA-RH Solutions inc.

Hi Nicolas,

Thank you very much for sharing further details.

I will update our development team and our team will be looking into this requirement. You’ll be updated with the results the earliest possible.

We’re sorry for the inconvenience.
Regards,

The issues you have found earlier (filed as 10802) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Hi Shahzad,

I downloaded the latest release (3.8.0.1), which contains the new Form.FormSubmitButtonNames property. I tried using it, however it always returns an empty list even with a PDF form containing a submit button.

I've attached one of the PDF file I used for my tests.

Thanks for your help,

Nicolas Venne
SIGMA-RH Solutions inc.

Hi Nicolas,

I have tested the issue with the attached pdf file and reproduced the problem. In fact, the problem is with this particular PDF due to some reasons, however the sample file at my end is working fine. Nevertheless, I have logged this issue as PDFKITNET-11700 in our issue tracking system. Our team will have to look into this issue. We’ll update you once the issue is resolved.

We’re sorry for the inconvenience.
Regards,

The issues you have found earlier (filed as 11700) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Hi Shahzad,

I tested the latest release and I can confirm it works perfectly now to extract the list of submit buttons.

Do you have any update on the issue concerning changing submit flags (PDFKITNET-10797) ?

Thanks in advance.

Regards,
Nicolas Venne
SIGMA-RH Solutions inc.

Hi Nicolas,

I’m sorry to inform you that the issue logged as PDFKITNET-10797 is not yet resolved. Also, due to certain limitations of this feature, we need to review and rewrite the code for this feature. This is logged as PDFKITNET-13388 in our issue tracking system. However, it might take some time. We’ll update you once the feature is fully supported.

We’re sorry for the inconvenience.
Regards,

I am trying to get a submit button to submit the whole PDF form. I add the submit button and set SubmitFlag to PDF but when I click on the submit button what is getting submitted is the form fields rather than the whole PDF file. Is this the same issue as PDFKITNET-10797?

Hi Craig,

In fact, this issue is logged under PDFKITNET-10797 and PDFKITNET-13388 in our issue tracking system. Our team is looking into this and you’ll be updated via this forum thread once this issue is resolved.

We’re sorry for the inconvenience.
Regards,

The issues you have found earlier (filed as 13388;10797) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.