fix demo 16
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
// Multiple sections and headers
|
// Multiple sections and headers
|
||||||
// Import from 'docx' rather than '../build' if you install from npm
|
// Import from 'docx' rather than '../build' if you install from npm
|
||||||
import * as fs from "fs";
|
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();
|
const doc = new Document();
|
||||||
|
|
||||||
@ -15,8 +15,8 @@ const footer = doc.createFooter();
|
|||||||
footer.createParagraph("Footer on another page");
|
footer.createParagraph("Footer on another page");
|
||||||
|
|
||||||
doc.addSection({
|
doc.addSection({
|
||||||
headerId: header.Header.ReferenceId,
|
headers: [{headerId: header.Header.ReferenceId, headerType: HeaderReferenceType.FIRST}],
|
||||||
footerId: footer.Footer.ReferenceId,
|
footers: [{footerId: footer.Footer.ReferenceId, footerType: FooterReferenceType.FIRST}],
|
||||||
pageNumberStart: 1,
|
pageNumberStart: 1,
|
||||||
pageNumberFormatType: PageNumberFormat.DECIMAL,
|
pageNumberFormatType: PageNumberFormat.DECIMAL,
|
||||||
});
|
});
|
||||||
@ -24,8 +24,8 @@ doc.addSection({
|
|||||||
doc.createParagraph("hello");
|
doc.createParagraph("hello");
|
||||||
|
|
||||||
doc.addSection({
|
doc.addSection({
|
||||||
headerId: header.Header.ReferenceId,
|
headers: [{headerId: header.Header.ReferenceId, headerType: HeaderReferenceType.FIRST}],
|
||||||
footerId: footer.Footer.ReferenceId,
|
footers: [{footerId: footer.Footer.ReferenceId, footerType: FooterReferenceType.FIRST}],
|
||||||
pageNumberStart: 1,
|
pageNumberStart: 1,
|
||||||
pageNumberFormatType: PageNumberFormat.DECIMAL,
|
pageNumberFormatType: PageNumberFormat.DECIMAL,
|
||||||
orientation: PageOrientation.LANDSCAPE,
|
orientation: PageOrientation.LANDSCAPE,
|
||||||
|
Reference in New Issue
Block a user