Simple import and export of document
This commit is contained in:
8
demo/85-template-document.ts
Normal file
8
demo/85-template-document.ts
Normal file
@ -0,0 +1,8 @@
|
||||
// Simple template example
|
||||
// Import from 'docx' rather than '../build' if you install from npm
|
||||
import * as fs from "fs";
|
||||
import { fromDocx } from "../build";
|
||||
|
||||
fromDocx(fs.readFileSync("demo/template.docx")).then((doc) => {
|
||||
fs.writeFileSync("My Document.docx", doc);
|
||||
});
|
Reference in New Issue
Block a user