Welcome aboard! We are happy you are here and wish you good net-raft!
// at first you must install npm install officegen
var officegen = require('officegen');
var fs = require('fs');
var pptx = officegen ('pptx');
var myfile = fs.createWriteStream ('mypptx.pptx');
slide = pptx.makeNewSlide ();
slide.back = '000000';
slide.addText ( [
{ text: 'Hello World!', options: { font_size: 35, font_face: 'Arial', color: 'ffff00', bold: true, align: 'center' } }
], { cx: '40%', cy: 66, y: 150, x: 300} );
slide.addText ( [
{ text: 'Nodejs is the best!', options: { font_size: 25, font_face: 'Arial', color: 'ffff00', bold: true, align: 'center' } }
], { cx: '40%', cy: 66, y: 200, x: 300} );
pptx.generate ( myfile, {
'finalize': function ( written ) {
console.log ( 'Finish to create a pptx file!' );
},
'error': function ( err ) {
console.log ( err );
}
});
The most helpful NODEJS solutions
get user ipNODEJS Click to see more ... 7.6K 1.7K