Change printer default paper size

前端 未结 2 783
一个人的身影
一个人的身影 2020-12-29 16:14

I have several custom paper sizes defined on a printer(the printer is set as default). I need to be able to select one of these formats as the default one.

A program

2条回答
  •  青春惊慌失措
    2020-12-29 17:17

    The following code would set the default printer papersize:

    PrintDocument pd = new PrintDocument();
    pd.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("PaperA4", 840, 1180);
    pd.Print();
    

    On how to print using PrintDocument you could refer this link.

    Hope this helps.

提交回复
热议问题