Merge branch 'master' of github.com:dolanmiu/docx into feat/declaritive

# Conflicts:
#	src/file/paragraph/run/run.ts
This commit is contained in:
Dolan
2019-08-06 21:06:06 +01:00
14 changed files with 380 additions and 54 deletions

27
demo/demo45.ts Normal file
View File

@ -0,0 +1,27 @@
import * as fs from "fs";
import { Document, Packer, Paragraph, TextRun } from "../build";
const doc = new Document();
const header = doc.Header.createTable(1, 3)
// @ts-ignore
header.properties.root[1] = []
header.getCell(0, 2).addParagraph(
new Paragraph()
.addRun(
new TextRun('W.P. 660')
.color('red')
.bold()
.size(12 * 2)
.font('Garamond')
.highlight('yellow')
)
.right()
)
const packer = new Packer();
packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

27
demo/demo46.ts Normal file
View File

@ -0,0 +1,27 @@
import * as fs from "fs";
import { Document, Packer, Paragraph, TextRun } from "../build";
const doc = new Document();
const header = doc.Header.createTable(1, 3)
// @ts-ignore
header.properties.root[1] = []
header.getCell(0, 2).addParagraph(
new Paragraph()
.addRun(
new TextRun('W.P. 660')
.color('red')
.bold()
.size(12 * 2)
.font('Garamond')
.shadow('pct10','00FFFF','FF0000')
)
.right()
)
const packer = new Packer();
packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});