This commit is contained in:
Dolan Miu
2023-02-25 22:18:56 +00:00
parent ce485dbc29
commit c9d86619de
9 changed files with 31 additions and 30 deletions

View File

@ -16,31 +16,31 @@ import {
patchDocument(fs.readFileSync("demo/assets/simple-template.docx"), {
patches: {
"name":{
name: {
type: PatchType.PARAGRAPH,
children: [new TextRun("Sir. "), new TextRun("John Doe"), new TextRun("(The Conqueror)")],
},
"table_heading_1": {
table_heading_1: {
type: PatchType.PARAGRAPH,
children: [new TextRun("Heading wow!")],
},
"item_1": {
item_1: {
type: PatchType.PARAGRAPH,
children: [new TextRun("#657")],
},
"paragraph_replace": {
paragraph_replace: {
type: PatchType.DOCUMENT,
children: [new Paragraph("Lorem ipsum paragraph"), new Paragraph("Another paragraph")],
},
"header_adjective": {
header_adjective: {
type: PatchType.PARAGRAPH,
children: [new TextRun("Delightful Header")],
},
"footer_text": {
footer_text: {
type: PatchType.PARAGRAPH,
children: [new TextRun("replaced just as well")],
},
"table": {
table: {
type: PatchType.DOCUMENT,
children: [
new Table({
@ -102,7 +102,6 @@ patchDocument(fs.readFileSync("demo/assets/simple-template.docx"), {
],
}),
],
}),
],
},

View File

@ -8,7 +8,7 @@ const doc = new Document({
{
children: [
new Paragraph({
children: [new TextRun("{{ template }}")],
children: [new TextRun("{{template}}")],
}),
],
},

Binary file not shown.