我想在一页上设置打印机设置Fit All列,epplus可以任意,请帮助我的代码:
Worksheet.PrinterSettings.PaperSize = ePaperSize.A4;
Worksheet.PrinterSettings.Orientation = eOrientation.Landscape;
Worksheet.PrinterSettings.FitToPage = true;
Worksheet.PrinterSettings.FitToWidth = 1;
我认为这有点反直觉,但你必须设置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;