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

Free Support Forum - aspose.com

JavascriptAction Garble


Add a script in ActionJavaScript of Aspose.Pdf

When you make a password set, the script you

ave set are garbled.

The script does not run

Are you sure you want if how resolved?


Aspose.Pdf.Document doc = new Aspose.Pdf.Document(@“C:\work\test.pdf”);

string script = “app.alert(‘TEST’);”;

Page page = doc.Pages[1];

page.Actions.OnOpen = new JavascriptAction(script);

doc.Encrypt("", “pass”, DocumentPrivilege.ForbidAll, CryptoAlgorithm.RC4x128, false);



Aspose.Pdf ver.

Thanks for taking care of it.

Hi Yuya,

for using our API’s.

I have tested the scenario and I am able to notice the same problem. For the sake of correction, I have logged this problem as PDFNEWNET-39348 in our issue tracking system. We will further look into the details of this problem and will keep you updated on the status of correction. Please be patient and spare us little time. We are sorry for this inconvenience.