Run borders

This commit is contained in:
Dolan
2022-01-06 04:36:55 +00:00
parent 2b0e8385f1
commit 531e240a37
3 changed files with 59 additions and 1 deletions

View File

@ -1,7 +1,7 @@
// Creates two paragraphs, one with a border and one without
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { BorderStyle, Document, Packer, Paragraph } from "../build";
import { BorderStyle, Document, Packer, Paragraph, TextRun } from "../build";
const doc = new Document({
sections: [
@ -25,6 +25,25 @@ const doc = new Document({
},
},
}),
new Paragraph({
children: [
new TextRun({
text: "This will ",
}),
new TextRun({
text: "have a border.",
border: {
color: "auto",
space: 1,
style: BorderStyle.SINGLE,
size: 6,
},
}),
new TextRun({
text: " This will not.",
}),
],
}),
],
},
],