node-pptx

1.0.0 • Public • Published

node-pptx

node-pptx npm module used to generate pptx along with the features of text add, image add, read existing template.

Using open source pptxgenjs plugin with some customization

Installation

npm i node-pptx --save

TEXT OPTIONS

 x ( x position)
 y ( y position)
 align
 font_size
 color
 w (width)
 h (height)
 autoFit

IMAGE OPTIONS

 path : Image Path
 x (x position)
 y (y position)
 w (width)
 h (height)

Sample

 
var NODE_PPTX   = require('node-pptx');
 
NODE_PPTX.createPresentation("/tmp/test-template.pptx").then(function(presentation){
    var slide = NODE_PPTX.addNewSlide();
    NODE_PPTX.addText(slide, "Hello World !!", { x:1, y:3, align:'c', font_size:40, color:'ffffff',w: 9.0,h:0.5,autoFit:true});
 
    var slide1 = NODE_PPTX.addNewSlide();
    NODE_PPTX.addText(slide1, "Hello World1 !!", { x:0.5, y:0.5, align:'c', font_size:20, color:'ffffff',w: 9.0,h:0.5,autoFit:true});
    NODE_PPTX.addImage(slide1, { path: './media/image4.jpeg', x:3.0, y:1.5, w:3, h:3});
 
    var slide2 = NODE_PPTX.addNewSlide();
    NODE_PPTX.addText(slide2, "Hello World3 !!", { x:1, y:3, align:'c', font_size:40, color:'ffffff',w: 9.0,h:0.5,autoFit:true});
 
    NODE_PPTX.generate("/tmp/test.pptx");
    res.send('Done !!')
});
 

Readme

Keywords

none

Package Sidebar

Install

npm i node-pptx

Weekly Downloads

24

Version

1.0.0

License

none

Unpacked Size

11.6 MB

Total Files

48

Last publish

Collaborators

  • anuragkumawat