Declarative hyperlinks, bookmarks, tab stops and page breaks

This commit is contained in:
Dolan
2019-09-30 22:56:21 +01:00
parent d2dded860d
commit 04b6d8e54a
20 changed files with 207 additions and 165 deletions

View File

@ -1,7 +1,7 @@
// Page numbers
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { AlignmentType, Document, Header, Packer, Paragraph, TextRun } from "../build";
import { AlignmentType, Document, Header, Packer, PageBreak, Paragraph, TextRun } from "../build";
const doc = new Document();
@ -26,8 +26,8 @@ doc.addSection({
},
children: [
new Paragraph({
text: "First Page",
}).pageBreak(),
children: [new TextRun("First Page"), new PageBreak()],
}),
new Paragraph("Second Page"),
],
});