1

I'm using print Document in my project. I've define custom page size in PrintPreview_Click(object sender, EventArgs e). When I print on A4 size paper, it shows result in the center of page (according defined size. but when I replace A4 page with small page. Half of my content didn't print. I've attached Pics of A4 paper print and Small paper. Kindly guide me where I'm Wrong. Thanks in advance.

This is Print Preview

This is the paper where I want to print

This is A4 Result

   private void PrintPreview_Click(object sender, EventArgs e)
        {
            printPreviewDialog1.Document = printDocument1;
            printDocument1.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("Custom", 446, 730);
            printPreviewDialog1.ShowDialog();
    }

1 Answer 1

1

In addition to setting "DefaultPageSettings.PaperSize", you can try to use "PrinterSettings.DefaultPageSettings.PaperSize" to set the "print area".

printDocument1.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("Custom", 446, 730);
printDocument1.PrinterSettings.DefaultPageSettings.PaperSize = printDocument1.DefaultPageSettings.PaperSize;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.