我想用epplus设置打印机设置“适合所有”列在一页上,请问可以帮助 我的代码:
Worksheet.PrinterSettings.PaperSize = ePaperSize.A4;
Worksheet.PrinterSettings.Orientation = eOrientation.Landscape;
Worksheet.PrinterSettings.FitToPage = true;
Worksheet.PrinterSettings.FitToWidth = 1;
答案 0 :(得分:5)
我认为这有点直觉,但您还必须设置worksheet.PrinterSettings.FitToHeight = 0
才能使它起作用。
这是设置打印工作表时通常使用的代码:
worksheet.PrinterSettings.PaperSize = ePaperSize.A4;
worksheet.PrinterSettings.Orientation = eOrientation.Portrait;
worksheet.PrinterSettings.HorizontalCentered = true;
worksheet.PrinterSettings.FitToPage = true;
worksheet.PrinterSettings.FitToWidth = 1;
worksheet.PrinterSettings.FitToHeight = 0;