Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

Adding Javascript to Push Button

$
0
0

Hi Team,

               Im trying to add a push button into a PDF and then adding javascript to the push button field which open the print pop up on click. But the javascript is not working.

The code which i tried:

Aspose.Pdf.

Document d = new Aspose.Pdf.Document(app_path + "Popup.pdf");

Aspose.Pdf.Facades.

FormEditor frm = new Aspose.Pdf.Facades.FormEditor(d);

frm.AddField(Aspose.Pdf.Facades.

FieldType.PushButton, "Print", "Printing", 1, 200, 700, 300, 725);

frm.SetFieldAppearance(

"Print", Aspose.Pdf.InteractiveFeatures.Annotations.AnnotationFlags.Print);

frm.SetFieldScript(

"Print", "window.print();");

frm.Save(ms);

Also find attached the PDF on which i applied this field and javascipt. Kindly help me on this issue.

      


Viewing all articles
Browse latest Browse all 3131

Trending Articles