Make tab and page numbers declarative

This commit is contained in:
Dolan
2019-11-21 01:02:46 +00:00
parent b2aeb2d83c
commit 7dfb016faa
17 changed files with 124 additions and 103 deletions

View File

@ -1,14 +1,21 @@
// Footnotes
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { Document, Packer, Paragraph, TextRun } from "../build";
import { Document, Packer, Paragraph, TextRun, FootnoteReferenceRun } from "../build";
const doc = new Document();
doc.addSection({
children: [
new Paragraph({
children: [new TextRun("Hello").referenceFootnote(1), new TextRun(" World!").referenceFootnote(2)],
children: [
new TextRun({
children: ["Hello", new FootnoteReferenceRun(1)],
}),
new TextRun({
children: [" World!", new FootnoteReferenceRun(2)],
}),
],
}),
new Paragraph("Hello World").referenceFootnote(3),
],