需要帮助,我正在使用PptxGen创建HTML的PowerPoint报告。我正在使用addSlidesForTable函数传递HTML表格ID,同时我还要求每张幻灯片的标题都带有一条直线,并且在HTML表格之后提供标题,但是表格位置不会影响ppt幻灯片的任何更改。
pptx =新的PptxGenJS();
pptx.setLayout('LAYOUT_WIDE');
pptx.defineSlideMaster({
title: 'MASTER_SLIDE',
bkgd: 'FFFFFF',
objects: [
{ 'line': { x: 0.5, y:0.0, w:12.00, line:'0088CC', lineSize:0.2,flipH:true,rotate:4.7 } },
{ 'line': { x: 0.5, y:6.0, w:12.00, line:'0088CC', lineSize:0.2,flipH:true,rotate:4.7 } },
{ 'text': { text:'Tabular Report', options:{ x:0.4, y:0.15, w:5.5, h:0.06, fontFace:'Arial',fontSize:20,color:'0088CC' } } }
],
slideNumber: { x:0.5, y:'95%', fontFace:'Arial',fontSize:8 }
});
var slide = pptx.addNewSlide('MASTER_SLIDE');
pptx.addSlidesForTable("tabAutoPaging1",{addHeaderToEach:true,master:'MASTER_SLIDE',options:{x:0.5, y:3.5} })
pptx.save('Sample Presentation');
答案 0 :(得分:0)
不提供options参数即可提供x和y位置。
您的addSlidesForTable方法调用应类似于
pptx.addSlidesForTable("tabAutoPaging1",{addHeaderToEach:true,master:'MASTER_SLIDE', x:0.5, y:3.5} })
答案 1 :(得分:0)
pptx.setLayout('LAYOUT_WIDE'); pptx.defineSlideMaster({ 标题:“ MASTER_SLIDE”, bkgd:'FFFFFF', 边距:[0.5,0.5,0.5,0.5], 对象:[ {'line':{x:0.5,y:0.0,w:12.00,line:'0088CC',lineSize:0.2,flipH:true,rotate:4.7}}, {'line':{x:0.5,y:6.0,w:12.00,line:'0088CC',lineSize:0.2,flipH:true,rotate:4.7}}, {'text':{text:'Tabular Report',选项:{x:0.4,y:0.15,w:5.5,h:0.06,fontFace:'Arial',fontSize:20,color:'0088CC'}}} ], slideNumber:{x:0.5,y:“ 95%”,fontFace:“ Arial”,fontSize:8} });
var slide = pptx.addNewSlide('MASTER_SLIDE');
pptx.addSlidesForTable("tabAutoPaging1",{addHeaderToEach:true,master:'MASTER_SLIDE',options:{x:0.5, y:3.5} })
pptx.save('Sample Presentation');