附上代码
- private void 导出PDfToolStripMenuItem_Click(object sender, EventArgs e)
- {
- if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- sfd.Title = "保存 Spread 为 PDF 格式";
- sfd.Filter = "Pdf 文件 |*.pdf";
-
- FarPoint.Win.Spread.PrintInfo printset = new FarPoint.Win.Spread.PrintInfo();
- printset.PrintToPdf = true;
- printset.Orientation = PrintOrientation.Landscape;
- printset.ZoomFactor = 0.85f;
- //设置打印范围
- printset.RowEnd = this.fpSpread1.Sheets[0].GetLastNonEmptyRow(FarPoint.Win.Spread.NonEmptyItemFlag.Data);
- printset.ColEnd = this.fpSpread1.Sheets[0].GetLastNonEmptyColumn(FarPoint.Win.Spread.NonEmptyItemFlag.Data);
- this.fpSpread1.AllowCellOverflow = true;
- printset.PdfFileName = sfd.FileName + ".PDF";
- //设置打印机设置然后打印。
- fpSpread1.Sheets[0].PrintInfo = printset;
- fpSpread1.PrintSheet(0);
- }
- }
- private void FormalReportCheckFrm_Load(object sender, EventArgs e)
- {
-
- fpSpread1.ZoomFactor = 1.158F;
- }
复制代码 |