在spreadjs中使用savePDF api导出pdf时, 注册了宋体字体,savePDF方法执行的时间很长(导出的表里面有10来个sheet页),要四五十秒这个怎么才能优化
- var fonts1 = {
- normal: fonts["simsun.ttf"]
- };
- this.workbook.suspendCalcService(false);
- this.workbook.suspendPaint()
- var start = new Date().getTime()
- GC.Spread.Sheets.PDF.PDFFontsManager.registerFont('宋体', fonts1);
- this.workbook.savePDF((blob) => {
- this.workbook.resumePaint();
- this.workbook.resumeCalcService(true)
- FaverSaver.saveAs(blob, "hello.pdf")
- console.log('time', new Date().getTime() - start)
- }, (error) => {
- console.log(error);
- }, {
- title: 'ssss',
- })
复制代码
|
|