From 1a3603dbfb811c1f59e59ae6da4082a75f52e7c7 Mon Sep 17 00:00:00 2001 From: amitm02 Date: Wed, 5 Sep 2018 10:02:42 +0300 Subject: [PATCH] fix demo 16 --- demo/demo16.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/demo/demo16.ts b/demo/demo16.ts index 4b92dc0d7e..336519a602 100644 --- a/demo/demo16.ts +++ b/demo/demo16.ts @@ -1,7 +1,7 @@ // Multiple sections and headers // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; -import { Document, Packer, PageNumberFormat, PageOrientation, Paragraph } from "../build"; +import { Document, Packer, PageNumberFormat, PageOrientation, Paragraph, HeaderReferenceType, FooterReferenceType } from "../build"; const doc = new Document(); @@ -15,8 +15,8 @@ const footer = doc.createFooter(); footer.createParagraph("Footer on another page"); doc.addSection({ - headerId: header.Header.ReferenceId, - footerId: footer.Footer.ReferenceId, + headers: [{headerId: header.Header.ReferenceId, headerType: HeaderReferenceType.FIRST}], + footers: [{footerId: footer.Footer.ReferenceId, footerType: FooterReferenceType.FIRST}], pageNumberStart: 1, pageNumberFormatType: PageNumberFormat.DECIMAL, }); @@ -24,8 +24,8 @@ doc.addSection({ doc.createParagraph("hello"); doc.addSection({ - headerId: header.Header.ReferenceId, - footerId: footer.Footer.ReferenceId, + headers: [{headerId: header.Header.ReferenceId, headerType: HeaderReferenceType.FIRST}], + footers: [{footerId: footer.Footer.ReferenceId, footerType: FooterReferenceType.FIRST}], pageNumberStart: 1, pageNumberFormatType: PageNumberFormat.DECIMAL, orientation: PageOrientation.LANDSCAPE,