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

Field Codes in SimpleField Formulas #2434

Closed
mattidupre opened this issue Dec 2, 2023 · 1 comment
Closed

Field Codes in SimpleField Formulas #2434

mattidupre opened this issue Dec 2, 2023 · 1 comment

Comments

@mattidupre
Copy link

I'm attempting to offset the Total Pages in my Header / Footer.

Tried the following (all within Header > Paragraph > TextRun):

  • new SimpleField('NUMPAGES + 1') // just renders NUMPAGES
  • new SimpleField('= NUMPAGES + 1') // !Undefined Bookmark, NUMPAGES
  • new SimpleField('= { NUMPAGES } + 1') // !Syntax Error, {
  • new SimpleField('{ = { NUMPAGES } + 1 }') // nothing rendered

Is this beyond the scope of the SimpleField class?

@dolanmiu
Copy link
Owner

Yes it is beyond the scope. Finding Total pages is a Microsoft Word or Word processor feature

The .docx document (ooxml) itself is dumb, and does not know about pages, it is simply an XML file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants