work on docx patcher
This commit is contained in:
@ -1,8 +1,10 @@
|
||||
// Simple template example
|
||||
// Import from 'docx' rather than '../build' if you install from npm
|
||||
import * as fs from "fs";
|
||||
import { fromDocx } from "../build";
|
||||
import { Paragraph, patchDocument, TextRun } from "../build";
|
||||
|
||||
fromDocx(fs.readFileSync("demo/template.docx")).then((doc) => {
|
||||
patchDocument(fs.readFileSync("demo/assets/simple-template.docx"), {
|
||||
children: [new Paragraph("ff"), new TextRun("fgf")],
|
||||
}).then((doc) => {
|
||||
fs.writeFileSync("My Document.docx", doc);
|
||||
});
|
||||
|
Reference in New Issue
Block a user