使用PrintInfo 设置,里面有很多参数,具体您也可以看下文档
- FarPoint.Web.Spread.PrintInfo printset = new FarPoint.Web.Spread.PrintInfo();
- printset.PrintType = FarPoint.Web.Spread.PrintType.All;
- printset.Orientation = FarPoint.Web.Spread.PrintOrientation.Landscape;
- FarPoint.Web.Spread.SmartPrintRulesCollection rules = new FarPoint.Web.Spread.SmartPrintRulesCollection();
- rules.Add(new FarPoint.Web.Spread.ScaleRule(FarPoint.Web.Spread.ResetOption.None, 1F, 0.1F, 0.1F));
- rules.Add(new FarPoint.Web.Spread.BestFitColumnRule(FarPoint.Web.Spread.ResetOption.None));
- printset.SmartPrintRules = rules;
- printset.UseSmartPrint = true;
- printset.SmartPrintPagesWide = 1;
- printset.SmartPrintPagesTall = 100;
- printset.BestFitCols = true;
- printset.BestFitRows = true;
- FpSpread1.Sheets[0].PrintInfo = printset;
- FpSpread1.SavePdf(@"D:\test.pdf");
复制代码 |