PrintInfo printInfo = new PrintInfo();
printInfo.ShowBorder = false;
printInfo.FooterCenter = "Page &P of &N";
printInfo.ShowRowHeader = VisibilityType.Hide;
printInfo.ShowColumnHeader = VisibilityType.Hide;
printInfo.FitPagesWide = -1;
printInfo.FitPagesTall = -1;
printInfo.ShowGridLine = false;
printInfo.HeaderCenter = "&A of &F";
printInfo.HeaderLeft = "&KFFFF00Color &KFF0000RedColor";
printInfo.BestFitColumns = true;
printInfo.UseMax = true;
foreach (var item in this.Gcspread1.Sheets)
{
item.PrintInfo = null;
}
foreach (var item in this.Gcspread1.Sheets)
{
item.PrintInfo = printInfo;
}
GrapeCity.Windows.SpreadSheet.Data.PdfExportSettings test;
test = new GrapeCity.Windows.SpreadSheet.Data.PdfExportSettings();
test.Title = "Print PDF";
test.Author = "奎屯公路, Inc.";
test.DisplayDocTitle = true;
test.FitWindow = true;
var stream = File.OpenWrite(@"D:\aaa.pdf");
Gcspread1.SavePdf(stream, test,new int[]{0,1});
stream.Dispose();
用这种方式导出的pdf文件打开报错,
|
|