0

需要帮助,我正在使用 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');
4

2 回答 2

0

提供不带选项参数的 x 和 y 位置。

您的 addSlidesForTable 方法调用应该像

pptx.addSlidesForTable("tabAutoPaging1",{addHeaderToEach:true,master:'MASTER_SLIDE', x:0.5, y:3.5} })
于 2018-10-27T05:36:10.230 回答
0

pptx.setLayout('LAYOUT_WIDE'); pptx.defineSlideMaster({ title: 'MASTER_SLIDE', bkgd: 'FFFFFF', margin:[0.5,0.5,0.5,0.5], 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,颜色:'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');
于 2018-11-02T05:37:02.713 回答