Free Support Forum - aspose.com

Validation & Webservice call on Submit button in Aspose.PDF generated PDF file

Hello Support-Team,

We are interesting to use Aspose.Pdf for .NET product. We have already downloaded trial version of same product and go through the product features.

We need a following things in sample web application.
1) Generate a PDF document from xml file using Aspose.Pdf.
2) There should be two FormField in generated PDF document like FirstName & ListName.
3) There should be a SubmitButton in PDF document to validate FirstName & LastName mandatory field and then post data to web-service.

We are implementing Aspose.pdf in sample web application and facing some issues. The sample web application generates a PDF file, then Open pdf document in Adobe , filling firstname & lastname detail and
click on submit button, When we click on submit botton, There is a validated
mandatory field value but same button click doesn’t post FormField data to
web-service if all fields are validated.
I have also mention code.

formEditor.AddSubmitBtn(“submitbutton”, 1, “Submit”, “http://localhost/PDFGeneration/PostData.asmx/SubmitData”, 100, 450, 150, 475);

formEditor.SetFieldScript(“submitbutton”, “var field = this.getField(‘FirstName’); if(field.value == ‘’) app.alert(‘Enter First Name’);if(this.getField(‘LastName’).value == ‘’) app.alert(‘Eneter Last Name’);”);

I have also verified that, there is a working fine either Validation or Webservice call but There is not working both validation and web-service call on same submit button.

Thanks

Hi Gaurang,


Thanks for using our products.

I
have tested the scenario and I am able to reproduce the same problem. For the
sake of correction, I have logged it in our issue tracking system as PDFNEWNET-34701. We
will investigate this issue in details and will keep you updated on the status
of a correction.

We
apologize for your inconvenience.

Hi Nayyer Shahbaz,


Thanks for prompt reply. Do you know how much time it will to take resolve that issue.Because we are running out of time and we need to resolution as early as possible. That’s was one of the main functionality for which we are looking for aspose pdf component.

Please reply on this as soon as possible. Hoping for favorable reply.

Regards,
Gaurang

Hi Gaurang,


As we just have noticed this problem, so until or unless development team has investigated and figured out the reasons of this problem, I am afraid currently its little difficult to estimate the timelines by which this problem will be resolved. Please note that each issue is resolved on its particular time frame and once the above stated problem is fixed, we would be more than happy to update you within this forum thread. Please be patient and spare us little time. We are sorry for this inconvenience.

PS, Due to your urgency, I have asked the development team to investigate this issue on High priority.

Hi Gaurang,


Thanks for your patience. I am pleased to share that the issue reported earlier PDFNEWNET-34701 has been resolved and its hotfix will be included in upcoming release version of Aspose.Pdf for .NET 7.7.0.

Please note that FormEditor.SetFieldScript overrides previously set submit form action specified for field. You may consider using DOM approach for more flexible action management:

[C#]

//create button<o:p></o:p>

ButtonField btn = new ButtonField(doc.Pages[1], new Rectangle(100, 450, 150, 475));

btn.Value = "Submit";

btn.PartialName = "submitbutton";

doc.Form.Add(btn, 1);

//create submit form action

string url = "http://localhost/PDFGeneration/PostData.asmx/SubmitData";

SubmitFormAction action = new SubmitFormAction();

FileSpecification urlSpec = new FileSpecification();

urlSpec.Name = url;

urlSpec.FileSystem = PdfConsts.URL;

action.Url = urlSpec;

action.Flags = SubmitFormAction.ExportFormat;

string script = "var field = this.getField('textfield'); if(field.value == '') app.alert('Enter First Name');";

//create JavaScript action

JavascriptAction js = new JavascriptAction(script);

//set OnActivate action to button

btn.OnActivated = action;

//add next action (javascript) to button:

btn.OnActivated.Next.Add(js);


Furthermore, please note that AddFieldScript method was added to FormEditor, this method adds javascript action as next action for button instead of replacing it:

[C#]

FormEditor formEditor = new FormEditor(

TestSettings.GetInputFile("34701.pdf"),

TestSettings.GetOutputFile("34701.pdf")

);

formEditor.AddSubmitBtn("submitbutton", 1, "Submit", "http://localhost/PDFGeneration/PostData.asmx/SubmitData", 100, 450, 150, 475);

formEditor.AddFieldScript("submitbutton", "var field = this.getField('textfield'); if(field.value == '') app.alert('Enter First Name');");

The issues you have found earlier (filed as PDFNEWNET-34701) have been fixed in Aspose.Pdf for .NET 7.7.0.


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

The issues you have found earlier (filed as PDFNEWNET-34701) have been fixed in Aspose.Pdf for .NET 7.7.0.


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