I'm trying to set up the print page for a document, using PageSetupDialog.
Before I open the dialog, the document is set correctly, page size and page source are set correctly too. But when I return from the dialog after select a different paper size and paper source, the paper size is not correctly reflected, while the paper source is fine. Yes, I am pressing OK button.
This issue is not new but so far there has been no proper answer.
PageSetupDialog dlgPageSetup = new PageSetupDialog();
dlgPageSetup.Document = this.printDocument1; //this is fine, assume that.
dlgPageSetup.PageSettings.PaperSize = new PaperSize("My Custom", 1012, 800);
dlgPageSetup.PageSettings.PaperSource.SourceName = "Envelope";
if (dlgPageSetup.ShowDialog(this) == DialogResult.OK) {
System.Diagnostics.Trace.WriteLine("DEBUG: "
+ dlgPageSetup.PageSettings.PaperSize);
System.Diagnostics.Trace.WriteLine("DEBUG: "
+ dlgPageSetup.PageSettings.PaperSource);
}
I'm using .Net 2.0, VS 2k5.
I am guessing this still is a bug, and its related to custom page size. Has anybody got solution for this problem?