Yamini Sarraf
Yamini Sarraf

Reputation: 3

Unable to set position of Html Table using PptxGenJs library

Need Help,I'm using PptxGen to create PowerPoint reports of HTML. I'm using function addSlidesForTable to pass HTML table id, also I have requirement to each slide provide title with one straight line and after that Html table but Table position has not affecting any changes in ppt slides.

pptx=new 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');

Upvotes: 0

Views: 1632

Answers (2)

Yamini Sarraf
Yamini Sarraf

Reputation: 3

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,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');

Upvotes: 0

sunny
sunny

Reputation: 748

Provide x and y positions without the options parameter.

Your addSlidesForTable method call should be like

pptx.addSlidesForTable("tabAutoPaging1",{addHeaderToEach:true,master:'MASTER_SLIDE', x:0.5, y:3.5} })

Upvotes: 0

Related Questions