Add support for jpg and bmp

This commit is contained in:
Dolan
2018-01-22 22:12:33 +00:00
parent 3dc6e71aaf
commit ccd655ef8b
4 changed files with 4 additions and 0 deletions

View File

@ -7,6 +7,8 @@ doc.addParagraph(paragraph);
const image = doc.createImage("./demo/images/image1.jpeg");
const image2 = doc.createImage("./demo/images/dog.png");
const image3 = doc.createImage("./demo/images/cat.jpg");
const image4 = doc.createImage("./demo/images/parrots.bmp");
var exporter = new docx.LocalPacker(doc);
exporter.pack('My Document');

BIN
demo/images/cat.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

BIN
demo/images/parrots.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 818 KiB

View File

@ -2,6 +2,8 @@
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
<Default Extension="png" ContentType="image/png"/>
<Default Extension="jpeg" ContentType="image/jpeg"/>
<Default Extension="jpg" ContentType="image/jpeg"/>
<Default Extension="bmp" ContentType="image/bmp"/>
<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" />
<Default Extension="xml" ContentType="application/xml" />
<Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml" />