Add ImageRun feature
This commit is contained in:
@ -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.
Reference in New Issue
Block a user