How to get predefined paper size by PaperKind

前端 未结 6 2115
迷失自我
迷失自我 2021-02-05 18:10

I need to get paper size by System.Drawing.Printing.PaperKind. Are there any predefined values? I don\'t want to hardcode or calculate paper sizes, I just want to get it program

6条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-05 19:00

    PaperSize pkSize;
    PrintDocument printDoc = new PrintDocument();
    for (int i = 0; i < printDoc.PrinterSettings.PaperSizes.Count; i++)
    {
        pkSize = printDoc.PrinterSettings.PaperSizes[i];
        cmbPaperSize.Items.Add(pkSize);
    }
    

提交回复
热议问题