How to restart Total Page Count for new section

I have a 3 page document for example, which will have 3 sections (1 per page).

I'm using this: TextobjHFT = new Text("Page $p of $P") in my footer obj.

However, I need the $P to restart after every section. The lower case current page is working correctly, however the $P is showing "of 3" instead.

The problem is I'm getting this for paging:

1 of 3

1 of 3

1 of 3

when it should be

1 of 1

1 of 1

1 of 1

I'm using this:

pdf1.IsPageNumberForDocument = false;
pdf1.IsPageNumberRestarted = true;

Thanks.

Hi Mike,


Thanks for your inquiry. Please use $SP symbol it displays page count of current section.Hopefully it will serve the purpose.Please check the replaceable symbols list here for your reference.

TextobjHFT = new Text(“Page $p of $SP”)

Please feel free to contact us for any further assistance.

Best Regards,

tilal.ahmad:
Hi Mike,

Thanks for your inquiry. Please use $SP symbol it displays page count of current section.Hopefully it will serve the purpose.Please check the replaceable symbols list here for your reference.

TextobjHFT = new Text("Page $p of $SP")

Please feel free to contact us for any further assistance.

Best Regards,

Worked well. Thanks.