I am converting a control to a bitmap and print it:
using (MemoryStream ms = new MemoryStream())
{
chart1.SaveImage(ms, ChartImageFormat.Bmp);
Bitmap bm = new Bitmap(ms);
PrintDocument doc = new PrintDocument();
doc.PrintPage += (s, ev) =>
{
ev.Graphics.DrawImage(bm, Point.Empty); // adjust this to put the image elsewhere
ev.HasMorePages = false;
};
doc.Print();
}
How can you specify to print it in landscape orientation?
doc.DefaultPageSettings.Landscape = true;
http://msdn.microsoft.com/en-us/library/system.drawing.printing.pagesettings.landscape.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With