Please help me on how to set my paper size in c# code. I am using the API printDocument.
Below is my code:
ppvw = new PrintPreviewDialog();
ppvw.Docume
You can use as follws and user can set the page size within the setting form.
private void button1_Click(object sender, EventArgs e)
{
PrintDialog printdg = new PrintDialog();
if (printdg.ShowDialog() == DialogResult.OK)
{
PrintDocument pd = new PrintDocument();
pd.PrinterSettings = printdg.PrinterSettings;
pd.PrintPage += PrintPage;
pd.Print();
pd.Dispose();
}
}
private void PrintPage(object o, PrintPageEventArgs e)
{
// Printng logic
}