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

Free Support Forum - aspose.com

How to show print dialog on the top of ASP.NET web control

Hi,i’m using aspose.words for printing options.

MemoryStream ms = new MemoryStream();
doc.Save(ms, SaveFormat.Pdf);

            PrintDialog printDlg = new PrintDialog();
            printDlg.AllowSomePages = true;
            printDlg.PrinterSettings.MinimumPage = 1;
            printDlg.PrinterSettings.MaximumPage = doc.PageCount;
            printDlg.PrinterSettings.FromPage = 1;
            printDlg.PrinterSettings.ToPage = doc.PageCount;
            if (printDlg.ShowDialog() == DialogResult.OK)

                AsposeWordsPrintDocument awPrintDoc = new AsposeWordsPrintDocument(doc);
                awPrintDoc.PrinterSettings = printDlg.PrinterSettings;

                PrintPreviewDialog previewDlg = new PrintPreviewDialog();
                previewDlg.Document = awPrintDoc;
                previewDlg.ShowInTaskbar = true;
                previewDlg.MinimizeBox = true;
                previewDlg.PrintPreviewControl.Zoom = 1;
                previewDlg.Document.DocumentName = doc.OriginalFileName;
                previewDlg.WindowState = FormWindowState.Maximized;
                previewDlg.Shown += PreviewDlg_Shown;


I wrote this code printing my document.
i have a requirement that PrintDialog should appear top of my all opened files.Its not happening.Its appearing behind of all opened files.
i wish to get like below image

image.png (253.1 KB)


Please note that Aspose.Words does not provide API to control PrintDialog. However, you can achieve your requirement as suggested in following article.

Cannot show print dialog on the top of asp.net web control

Thank you .it helps