首先设置ZoomFactor是可以的,报错可能是您环境的问题,这个您可以调试然后搜索下解决方案。
用其他设置也能达到您的要求,下面是示例代码,SmartPrintPagesTall设置大一些,SmartPrintPagesWide设置为1
- FarPoint.Win.Spread.PrintInfo printset = new FarPoint.Win.Spread.PrintInfo();
- printset.PrintType = FarPoint.Win.Spread.PrintType.All;
- printset.Orientation = FarPoint.Win.Spread.PrintOrientation.Landscape;
- printset.Preview = true;
- printset.ShowPrintDialog = true;
- FarPoint.Win.Spread.SmartPrintRulesCollection rules = new FarPoint.Win.Spread.SmartPrintRulesCollection();
- rules.Add(new FarPoint.Win.Spread.ScaleRule(FarPoint.Win.Spread.ResetOption.None, 1F, 0.1F, 0.1F));
- rules.Add(new FarPoint.Win.Spread.BestFitColumnRule(FarPoint.Win.Spread.ResetOption.None));
- printset.SmartPrintRules = rules;
- printset.UseSmartPrint = true;
- printset.SmartPrintPagesWide = 1;
- printset.SmartPrintPagesTall = 100;
- printset.BestFitCols = true;
- printset.BestFitRows = true;
- // printset.ZoomFactor = 0.3F;
- fpSpread1.Sheets[0].PrintInfo = printset;
- fpSpread1.PrintSheet(0);
- }
复制代码 |