SetSubmitUrl changes the export format value?

Hello,

I'm using the Aspose.Pdf.Kit (.NET version). I've a pdf document with some form fields and I'm trying to accomplish these steps:

1 - Read the document and fill the form fields with Aspose.Pdf.Kit.
2 - Embed the resulting document (stream) in a asp.net page.
3 - Then the user can change the value of some fields and click a submit button in the pdf to submit it via HTTP POST to the server.

The first two steps are working correctly. My problem is the last step. I've added a submit button in the document (btnSubmit) at desing time, setted the url and setted the export format as HTML: it worked just fine! But the submit url must be dynamic... and I don't know the url in advance. So it must be set at run-time. I tried to use the FormEditor.SetSubmitUrl method to change the url. The url changes, but the submit does not work correctly anymore (The submit works, but in a different format (FDF)). It seems that after using SetSubmitUrl, the export format value is changed to the default value (FDF). How can I workaround this problem? Is it a bug in Apose.Pdf.Kit?

Thanks in advance.

Best regards,

André Machado

Hi André,

Please share the PDF file and the code snippet you're working with, so that we'll be able to reproduce the scenario at our end. It'll help us diagnose the problem.

We're are sorry for the inconvenience.

Regards,

Hello,

Thanks for your help! I've attached a sample application (VS 2008, .NET Framework 3.5 SP1, Aspose.Pdf.Kit 3.4.0.0). You can run the sample web application and browse to Default.aspx. You will have two choices (links):

. Change document's submit URL with Aspose.Pdf.Kit
. Do not change the document's submit URL (use the one setted at design time)

If you click the second link, it'll work. A web page with the pdf document embedded will be loaded. This pdf document has a submit button that posts the form to the server as a HTML form. The page HTTPRequestHandler.aspx will receive the request and show de form fields name and value. And also the content-type for the request (form).

Now, if you click the first link, a page will read the PDF with Aspose.Pdf.Kit and use the SetSubmitUrl to change the submit url value in the button (in fact the url is the same one already configured at design-time; I'd like to show only that after the method call the export format is resetted). After that, the document is saved as a data stream and sent to the browser. A web page will show this streamed document. You can fill the fields and click the submit button. The same HTTPRequestHandler.aspx page will receive the request, but this time there aren't any fields to read and the content-type will be different (vdf).

So, I'd like to demonstrate that after a call to SetSubmitUrl, not only the url is changed; the export format of the form is also changed. Am I doing something wrong in this sample? I tried the same method in the PdfForm class, but it didn't work either.

If you need more information just let me know, ok?

Again, thank you for you help.

André Machado

Hi André,

I have reproduced the problem at my end and logged it as PDFKITNET-9217 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 appreciate your patience.

Regards,

Hello,

Thank you for your feedback. I'll wait for a response then.

Regards,

André

Hi,

I also have this problem. The issue is 4 months old now any fix in sight?. I’m trialing your latest version so guessing: not yet.

Considering PDF Kit as it gets around a showstopper I have with PDF4NET. However, now I have another show stopper with this :frowning:

EDIT:

Oops misread post dates I see this issue is actually very new.

If you are willing to submit the form using javascript here is a work around that works for me:

Create a hidden TextField in the PDF Form
Use Form.FillField(“HiddenFieldName”, “DynamicUrl”) to put your runtime URL into the form
For your submit button, in the actions tab (assuming Acrobat 9 here coz that’s what I’m using) For the mouse up action instead of a submit form action choose 'Run a JavaScript’
Use this java-script:

var myfield = this.getField(“HiddenFieldName”);
var myUrl = myfield .value;
this.submitForm({cURL:myUrl,cSubmitAs:“PDF”, cUsageRights:submitFormUsageRights.RMA});

Hello,

Thank you for the workaround!

Regards,

André

Thanks for cas_o's help. But I cannot remember there was such a issue that we did not solve it over 4 months. Would you please tell me the url of the post?

In fact, we are working hard on this issue now. Basically, a SubmitForm field modified by SetSubmitUrl() will submit the page as FDF format by default. Thus the SetSubmitUrl() changed the original format. This bug will be fixed in one week, and the fix will be included in the next release. Please check the attachment and tell me whether the output file is what you need or not. Thanks.

Thanks for cas_o’s help. But I cannot remember there was such a issue
that we did not solve it over 4 months. Would you please tell me the
url of the post?

That’s because there wasn’t it’s my mistake. If you read my edited post I admit my mistake that this is a new issue and not an old one. Sorry for any confusion.

Looking forward to the fix thanks.

Hello Luke,

I checked the attachment and it's exactally what I need. The SetSubmitUrl() method must modify only the url, right?

I'm looking forward for this fix. Thank you very much.

Regards,

André

This issue has been solved, and it will be included in the next coming release. Thanks for your patience.

Best regards.

Hello,

Thank you very much!

Regards,

André

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


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

Thank you!

Regards,

André