PrinterSettings ps = new PrinterSettings(); PrintDocument recordDoc = new PrintDocument(); recordDoc.PrinterSettings = ps;
here you can set the paper size to "A4", for example
IEnumerable<PaperSize> paperSizes = ps.PaperSizes.Cast<PaperSize>(); PaperSize sizeA4 = paperSizes.First<PaperSize>(size => size.Kind == PaperKind.A4);
and here is another way to set the size of custom paper
recordDoc.DefaultPageSettings.PaperSize = new PaperSize("210 x 297 mm", 800, 800); PrintPreviewDialog ppvw = new PrintPreviewDialog(); ppvw .Document = recordDoc; ppvw.ShowDialog();
Hope this works.
source share