I have the same problem not able to print in landscape. I did do the similar
coding but it's not working. Can you see what I'm doing wrong? Thanks.
private void btnPrint_Click(object sender, System.EventArgs e)
{
pdocNYMedicaid.DefaultPageSettings.Landscape = true;
Margins margins = new Margins(0,0,0,0);
pdocNYMedicaid.DefaultPageSettings.Margins = margins;
PrintDialog pdocDialog = new PrintDialog();
pdocDialog.Document = this.pdocNYMedicaid;
if(pdocDialog.ShowDialog()== DialogResult.OK)
{
pdocNYMedicaid.PrinterSettings = pdocDialog.PrinterSettings;
pdocNYMedicaid.Print();
}
}
"Jeff Louie" wrote:
[C#]
public void Printing() {
try {
streamToPrint = new StreamReader (filePath);
try {
printFont = new Font("Arial", 10);
PrintDocument pd = new PrintDocument();
pd.PrintPage += new PrintPageEventHandler(pd_PrintPage);
pd.PrinterSettings.PrinterName = printer;
// Set the page orientation to landscape.
pd.DefaultPageSettings.Landscape = true; // ********* //
pd.Print();
}
finally {
streamToPrint.Close() ;
}
}
catch(Exception ex) {
MessageBox.Show(ex.Message);
}
}
Regards,
JeffI want to find out how I can change the page orientation of a printer.<
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!