deno.land / x / docx@8.5.0 / demo / 87-template-document.ts

87-template-document.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Patch a document with patches
import * as fs from "fs";import { patchDocument, PatchType, TextRun } from "docx";
patchDocument(fs.readFileSync("demo/assets/simple-template-2.docx"), { patches: { name: { type: PatchType.PARAGRAPH, children: [new TextRun("Max")], }, },}).then((doc) => { fs.writeFileSync("My Document.docx", doc);});
docx

Version Info

Tagged at
4 months ago