Fix demos

This commit is contained in:
Dolan
2019-11-21 01:12:32 +00:00
parent 7dfb016faa
commit bf1d10e893
3 changed files with 33 additions and 8 deletions

View File

@ -1,7 +1,7 @@
// Multiple sections with total number of pages in each section
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { AlignmentType, Document, Packer, PageNumberFormat, TextRun, Header, Paragraph, Footer, PageBreak } from "../build";
import { AlignmentType, Document, Footer, Header, Packer, PageBreak, PageNumber, PageNumberFormat, Paragraph, TextRun } from "../build";
const doc = new Document();
@ -10,7 +10,9 @@ const header = new Header({
new Paragraph({
children: [
new TextRun("Header on another page"),
new TextRun("Page Number: ").pageNumber(),
new TextRun({
children: ["Page number: ", PageNumber.CURRENT],
}),
new TextRun(" to ").numberOfTotalPagesSection(),
],
alignment: AlignmentType.CENTER,