docx
docx copied to clipboard
Change page number font
Hello, Is there any way to change font of page number? Font changes fine from default in "Page | " part, but then in the next TextRun it always prints page number in Times New Roman.
Here is example of the code
paragraph(
{
alignment: docx.AlignmentType.RIGHT,
children: [
new TextRun({
font: FontFamily,
text: "Page | ",
}),
new TextRun({
font: FontFamily,
children: [docx.PageNumber.CURRENT],
}),
],
}
),
Try something like this:
https://github.com/dolanmiu/docx/blob/master/demo/45-highlighting-text.ts
I also tried uniting two TextRuns and applying styling from examle. Styles work on "Page | " but not on page number. Dont really any got idea why it works like this
children: [
new TextRun({
color: "FF0000",
bold: true,
font: {
name: FontFamily,
},
children: ["Страница | ", docx.PageNumber.CURRENT],
}),
],