BLOG.CSHARPHELPER.COM: Print in landscape orientation and adjust a printout's margins in C#
Print in landscape orientation and adjust a printout's margins in C#
By default, when you display a print preview or print a document, the document appears in portrait orientation with one inch margins. To change that, set the PrintDocument's DefaultPageSettings properties before displaying the preview as in the following code.
This code sets the page's margins to half inch (measured in hundredths of inches) and makes it appear in landscape orientation. It then displays the print preview dialog.
Comments