fix demos. BREAKING: PageNumberFormat enum renamed to NumberFormat
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, Footer, Header, Packer, PageNumber, PageNumberFormat, PageOrientation, Paragraph, TextRun } from "../build";
|
import { Document, Footer, Header, Packer, PageNumber, NumberFormat, PageOrientation, Paragraph, TextRun } from "../build";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
@ -13,7 +13,7 @@ const doc = new Document({
|
|||||||
page: {
|
page: {
|
||||||
pageNumbers: {
|
pageNumbers: {
|
||||||
start: 1,
|
start: 1,
|
||||||
formatType: PageNumberFormat.DECIMAL,
|
formatType: NumberFormat.DECIMAL,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -38,7 +38,7 @@ const doc = new Document({
|
|||||||
},
|
},
|
||||||
pageNumbers: {
|
pageNumbers: {
|
||||||
start: 1,
|
start: 1,
|
||||||
formatType: PageNumberFormat.DECIMAL,
|
formatType: NumberFormat.DECIMAL,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -85,7 +85,7 @@ const doc = new Document({
|
|||||||
orientation: PageOrientation.PORTRAIT,
|
orientation: PageOrientation.PORTRAIT,
|
||||||
},
|
},
|
||||||
pageNumbers: {
|
pageNumbers: {
|
||||||
formatType: PageNumberFormat.UPPER_ROMAN,
|
formatType: NumberFormat.UPPER_ROMAN,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -116,7 +116,7 @@ const doc = new Document({
|
|||||||
},
|
},
|
||||||
pageNumbers: {
|
pageNumbers: {
|
||||||
start: 25,
|
start: 25,
|
||||||
formatType: PageNumberFormat.DECIMAL,
|
formatType: NumberFormat.DECIMAL,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Example how to display page numbers
|
// Example how to display page numbers
|
||||||
// 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 { AlignmentType, Document, Footer, Header, Packer, PageBreak, PageNumber, PageNumberFormat, Paragraph, TextRun } from "../build";
|
import { AlignmentType, Document, Footer, Header, Packer, PageBreak, PageNumber, NumberFormat, Paragraph, TextRun } from "../build";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
@ -10,7 +10,7 @@ const doc = new Document({
|
|||||||
page: {
|
page: {
|
||||||
pageNumbers: {
|
pageNumbers: {
|
||||||
start: 1,
|
start: 1,
|
||||||
formatType: PageNumberFormat.DECIMAL,
|
formatType: NumberFormat.DECIMAL,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Multiple sections with total number of pages in each section
|
// Multiple sections with total number of pages in each section
|
||||||
// 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 { AlignmentType, Document, Footer, Header, Packer, PageBreak, PageNumber, PageNumberFormat, Paragraph, TextRun } from "../build";
|
import { AlignmentType, Document, Footer, Header, Packer, PageBreak, PageNumber, NumberFormat, Paragraph, TextRun } from "../build";
|
||||||
|
|
||||||
const header = new Header({
|
const header = new Header({
|
||||||
children: [
|
children: [
|
||||||
@ -31,7 +31,7 @@ const doc = new Document({
|
|||||||
page: {
|
page: {
|
||||||
pageNumbers: {
|
pageNumbers: {
|
||||||
start: 1,
|
start: 1,
|
||||||
formatType: PageNumberFormat.DECIMAL,
|
formatType: NumberFormat.DECIMAL,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -52,7 +52,7 @@ const doc = new Document({
|
|||||||
page: {
|
page: {
|
||||||
pageNumbers: {
|
pageNumbers: {
|
||||||
start: 1,
|
start: 1,
|
||||||
formatType: PageNumberFormat.DECIMAL,
|
formatType: NumberFormat.DECIMAL,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user