Aspose.Pdf.Annotations.JavascriptAction Microsoft Edge Error


We use the following code to extract print dialog in pdf document.

Aspose.Pdf.Document doc = new Aspose.Pdf.Document(fs);
doc.OpenAction = new Aspose.Pdf.Annotations.JavascriptAction(“this.print(true);”);
doc.Save(su.MapPath("…/…/QDMSFiles/TEMPFOL/") + tempFileName.Substring(0, tempFileName.LastIndexOf(’.’)) + “_NoData.pdf”);

However, there is no print dialog in the “Microsoft Edge”.



Thank you for contacting support.

Please note that browsers are not full fledged document processing applications and may not support all the features. The PDF viewer built into Microsoft Edge does not execute the JavaScript in the PDF document even if the the JavaScript is added with Adobe Acrobat so we are afraid this may not be a lacking feature or problem with Aspose.PDF for .NET API.

We hope this will be helpful. Please feel free to contact us if you need any further assistance.


We started getting this error after the google chrome (77.0.3865.90) update. So what action should we take?


Would you please elaborate if the error was not occurring previously before updating Google Chrome? If this is the case then please check the same with a PDF document created with Adobe Acrobat so that we may narrow down if it is a general problem that occurs with Adobe generated documents or not. If yes, then Chrome support may be helpful for that scenario. Let us know your observations while sharing sample PDF document.

We use this code,

Aspose.Words.Document word = new Document(“original.docx”);

        Aspose.Words.Saving.PdfSaveOptions opts = new Aspose.Words.Saving.PdfSaveOptions();
        word.Save("output.pdf", opts);

        Aspose.Pdf.Document doc = new Aspose.Pdf.Document("output.pdf");
        doc.OpenAction = new Aspose.Pdf.Annotations.JavascriptAction("this.print(true);");

And document("yazdir.pdf ") is opened with “internet explorer” print dialog opens. However, it won’t open when opened with “Google Chrome”. (148.7 KB)


Thank you for elaborating it.

We have been able to notice the problem but it occurs only when Chrome is updated. The PDF file remains same so you may reach out to Google at Chrome Help Community for further assistance.


Do you have any other suggestions about open print dialog?


We are of the opinion that Google can look into this because the only change is updating Chrome. Otherwise the PDF document is good where the browser may have discarded execution of JavaScript.