Files
docx-js/demo/demo5.js
2018-01-16 00:43:00 +00:00

14 lines
334 B
JavaScript

const docx = require('../build');
var doc = new docx.File();
var paragraph = new docx.Paragraph("Hello World");
doc.addParagraph(paragraph);
const image = doc.createImage("./demo/image1.jpeg");
var exporter = new docx.LocalPacker(doc);
exporter.pack('My Document');
console.log('Document created successfully at project root!');