Change image API so that it now sends Images

This commit is contained in:
Dolan
2018-08-03 00:01:42 +01:00
parent 31fdf08c27
commit 5f22950721
8 changed files with 42 additions and 58 deletions

View File

@ -6,8 +6,8 @@ var doc = new docx.Document();
const table = doc.createTable(4, 4);
table.getCell(2, 2).addContent(new docx.Paragraph('Hello'));
const imageData = docx.Media.addImage(doc, "./demo/images/image1.jpeg");
table.getCell(1, 1).addContent(new docx.Image(imageData));
const image = docx.Media.addImage(doc, "./demo/images/image1.jpeg");
table.getCell(1, 1).addContent(image);
var exporter = new docx.LocalPacker(doc);
exporter.pack('My Document');