Add ImageRun feature

This commit is contained in:
Dolan Miu
2023-03-03 23:47:50 +00:00
parent fe9b438a51
commit 66a1992da0
9 changed files with 141 additions and 11 deletions

View File

@ -3,6 +3,7 @@
import * as fs from "fs";
import {
HeadingLevel,
ImageRun,
Paragraph,
patchDocument,
PatchType,
@ -40,6 +41,10 @@ patchDocument(fs.readFileSync("demo/assets/simple-template.docx"), {
type: PatchType.PARAGRAPH,
children: [new TextRun("replaced just as well")],
},
image_test: {
type: PatchType.PARAGRAPH,
children: [new ImageRun({ data: fs.readFileSync("./demo/images/image1.jpeg"), transformation: { width: 100, height: 100 } })],
},
table: {
type: PatchType.DOCUMENT,
children: [

Binary file not shown.