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

Free Support Forum - aspose.com

Push button support

I am evaluating ASPOSE.PDF and I have a few questions:

1. Using ASPOSE, can I generate PDF file with buttons that submit the form to a web server?

2. Can I inject Javascript into the PDF file? I need to do forms validation and sub-totalling.

3. We need to have users enter data into the form fields. I assume that this can be done.

4. Can I open an existing PDF file and make modifications? For example, replace tokens

Thanks

Mitch Stephens

Dear Mitch,

Thank you for considering Aspose.

1. Buttons are supported in FormField but submitting the form to a web server is not supported;

2. JavaScript is not supported. We will consider supporting this feature later.

3. It is supported as you said.

4. Modifying existing PDF is supported in Aspose.Pdf.Kit. But replace tokens is not supported yet. I think that function will be supported soon.

Hi,

I need help for access javascript on pdf file. I used "Pdf pdf1 = new Pdf();" and pdf.save("C:\myPdf.pdf"); or Pdf pdf = new Pdf("doStream"); pdf.close() but my file it don't update script, I want call one function in Event of Button. How do for this?

Please help ! thanks.

Hello Toan,

Thanks for considering Aspose.

Before commenting over calling function calling in javascript over pdf, can you please expalin the detials of function which you need to call ?

Let me share something with you, Acrobat javascript does not have access to objects within an HTML page. Similarly, HTML javascript cannot access objects within pdf file.

Hi codewarior,

I have a button when click on button it will show dialog two radio button, I write a function for set cases into this button by call add actionscript with "function SetStatusRadio(radItem);" radItem with value 0/1 with 0: it show one radio button on dialog, with 1: show two radio button on dialog. I want do it on C# code for call function SetStatusRadio(1/0), how do for this. Please help me how open myPdf file by Aspose for call javascript into button, if have some link example it will help me :)

^^ help me ! thanks :)

Hi,

If I understand you correct, you want to update JavaScripts in existing PDF. That is not supported in the current version of our products. We will investigate this issue and try to support it in the future version.

Dear Mitch,

Thanks for considering Aspose.Pdf.Kit.

For your question:
1. Using ASPOSE, can I generate PDF file with buttons that submit the form to a web server?
I would like to add some more comments.

Actually FormEditor.AddSubmitBtn() can add a submit button to existing PDF template,e.g.:

FormEditor formeditor = new FormEditor( "addSubmitBtn.6.in.pdf", "out.pdf");
String mailurl = "mailto:Luke.fu@aspose.com";
formeditor.AddSubmitBtn("SubmitBtn1", 1, "Mail to Me",mailurl, 50, 760, 130, 778);
String httpurl = "<A href="</FONT></A><FONT color=#0000ff size=2>";
formeditor.AddSubmitBtn("SubmitBtn2", 1, "Submit",httpurl, 250, 760, 330, 778);
formeditor.Save();

While FormEditor.SetSubmitUrl() can change the submit url of a submit button, e.g.:

FormEditor formeditor = new FormEditor("input.pdf", "output.pdf");
formeditor.SetSubmitUrl("SubmitBtn1", "www.aspose.com");
formeditor.SetSubmitUrl("SubmitBtn2", "mailto:luke.fu@aspose.com");
formeditor.Save();

I am not sure whether they would fullfill your requirement completely, please test it.

Best regards.