I’m currently using Aspose.Pdf.Generator.Pdf to build my PDF.
Hi John,
I tried that, and it’s still not working, see the code below:
Hi John,
Hi John,
I
have tested the scenario and I am able to reproduce the same problem that JavaScript is not being added to button already present in PDF file (button created with Aspose.Pdf.Generator). For the
sake of correction, I have logged it in our issue tracking system as PDFNEWNET-35837. We
will investigate this issue in details and will keep you updated on the status
of a correction. <o:p></o:p>
We apologize for your inconvenience.
The issues you have found earlier (filed as PDFNEWNET-35837) have been fixed in Aspose.Pdf for .NET 8.7.0.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
Hi John,
Document doc = new Document();<o:p></o:p>
Page page = doc.Pages.Add();<o:p></o:p>
//BUTTON<o:p></o:p>
ButtonField btnElement = new ButtonField();<o:p></o:p>
btnElement.PartialName = “Button1”;<o:p></o:p>
btnElement.Value = “button1”;<o:p></o:p>
TextFragment Element = new TextFragment("Button: ");<o:p></o:p>
//Element.Segments.Add().InlineParagraph = btnElement;<o:p></o:p>
btnElement.Width = 80;<o:p></o:p>
btnElement.Height = 20;<o:p></o:p>
page.Paragraphs.Add(Element);<o:p></o:p>
page.Paragraphs.Add(btnElement);<o:p></o:p>
//Add Java Script<o:p></o:p>
MemoryStream src = new MemoryStream();<o:p></o:p>
doc.Save(src);<o:p></o:p>
FormEditor frm = new FormEditor();<o:p></o:p>
frm.BindPdf(src);<o:p></o:p>
frm.SetFieldScript(“Button1”, “app.alert(‘Hello World!’);”);<o:p></o:p>
frm.Save(“PushButton_out.pdf”);<o:p></o:p>
Please feel free to contact us for any further assistance.
Best Regards,
Out of curiosity, could someone detail the reason behind why the code in my third post doesn’t work (and required a change of code to function).
Hi John,