Free Support Forum -

Metod PrintDocumentWithSetup in class PdfViewer


It says in the API that this method should print document after showing a print dialog in which you can
choose printer. When we uses this method we get a dialog in which you only can select pagesettings.
Are there any plans to include choosing printer in this dialog?


Daniel Backman

Hi Daniel,

Thanks for your inquiry. You can easily achieve your requirements of displaying print dialog using PrintDialog object. Please check following documentation link/code snippet for details. Hopefully it will serve the purpose.

PdfViewer viewer = new PdfViewer();
viewer.AutoResize = true;
viewer.AutoRotate = true;

System.Windows.Forms.PrintDialog printDialog = new System.Windows.Forms.PrintDialog();
if (printDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
System.Drawing.Printing.PrinterSettings ps = printDialog.PrinterSettings;
System.Drawing.Printing.PageSettings pgs = new System.Drawing.Printing.PageSettings();
pgs.PaperSize = new System.Drawing.Printing.PaperSize(“A4”, 827, 1169);
pgs.Margins = new System.Drawing.Printing.Margins(0, 0, 0, 0);
viewer.PrintDocumentWithSettings(pgs, ps);

Best Regards,


Thanks for the answer I will try your suggestion.


Daniel Backman