For example, here we set different orientations for pages depending on condition:
printDocument = new PrintDocument(); printDocument.QueryPageSettings += printDocument_QueryPageSettings; void printDocument_QueryPageSettings(object sender, QueryPageSettingsEventArgs e) { e.PageSettings.Landscape = true; if (some_condition_here) { e.PageSettings.Landscape = false; } }Generally, you should handle PrintPage event also, for instance, to specify whether you have more pages to print or not.