Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change page number font #1897

Open
qusysert opened this issue Jan 23, 2023 · 2 comments
Open

Change page number font #1897

qusysert opened this issue Jan 23, 2023 · 2 comments
Labels

Comments

@qusysert
Copy link

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],
          }),
      ],
  }
),
@dolanmiu
Copy link
Owner

@qusysert
Copy link
Author

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],
    }),
],

@dolanmiu dolanmiu added the bug label Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants