Extract runs and text

This commit is contained in:
Dolan
2023-02-17 10:38:03 +00:00
parent c206d23480
commit 86de252a52
6 changed files with 144 additions and 12 deletions

View File

@ -4,7 +4,12 @@ import * as fs from "fs";
import { Paragraph, patchDocument, TextRun } from "../build";
patchDocument(fs.readFileSync("demo/assets/simple-template.docx"), {
children: [new Paragraph("ff"), new TextRun("fgf")],
patches: [
{
children: [new Paragraph("ff"), new TextRun("fgf")],
text: "{{ name }}",
},
],
}).then((doc) => {
fs.writeFileSync("My Document.docx", doc);
});

Binary file not shown.