找回密码
 立即注册

QQ登录

只需一步,快速开始

zxfreg

初级会员

42

主题

132

帖子

352

积分

初级会员

积分
352

微信认证勋章

zxfreg
初级会员   /  发表于:2017-6-1 18:05  /   查看:3289  /  回复:2
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文件打开报错,

2 个回复

倒序浏览
zxfreg
初级会员   /  发表于:2017-6-1 18:11:15
沙发
用设计器导出的pdf文件打开也报这个错误
回复 使用道具 举报
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2017-6-2 16:22:07
板凳
可以提供下重现的Demo吗,或者如果您需要导出内容的模板。
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部