PageNumberStyle does not affect field NUMPAGES

I have a page number format of:

builder.PageSetup.PageNumberStyle = NumberStyle.LowercaseLetter

Using fields {PAGE} and {NUMPAGES}, I get:

Page b of 3

rather than

Page b of c

Am I missing something, or is there no way to set the numpages number format?

This is important for what I am really doing, because I am using a formula field to only print a footer on the last page, i.e.:

{ IF "{PAGE}" = "{NUMPAGES}" "some text" "" }

So, I get the expression "If c = 3" which is false, but should be true as "c=c".

I am thinking of trying to add some formula like ASC(NUMPAGES)-96 = PAGE, but was thinking I must be missing something to get the number of pages formatted correctly. What is your suggestion?

Thanks.

UPDATE:

Was unable to get CHR() or ASC() function to work and stopped trying to make this method work knowing that I would have problems with documents over 26 pages.


This message was posted using Aspose.Live 2 Forum

Hi there,

Thanks for your inquiry.

You're right, the NUMPAGES field is not affected by the PageNumberStyle setting, even within MS Word as well. Instead please try specifying the number formatting on both the fields by using the formatting switches. This creates the output you are looking for:

{PAGE \* alphabetic}, {NUMPAGES \* alphabetic}

Thanks,

Yes, that worked:

builder.InsertField("NUMPAGES \\* alphabetic", null);

I am very satisfied with the support I have received on this product during this intial start-up period.

I have given our accounting department the go-ahead to process the invoice for Aspose.Total.

Thanks.