I have a document which contains a letter followed by customer statement. The customer statement can vary from 4 to 10 pages.
I want to show page x of y in the footer of the customer statement where x and y are based on the statement excluding the letter.
Using the field NUMPAGES is not good since it includes the letter in the count.
Using document.pagecount works for WORD but not for PDF. (Hard coded values seem to work for PDF).
Here is the code
'set 3rd cell = 1/4 page width
builder.CellFormat.Width = TableWidth / 4
builder.Write(" of ")
' builder.InsertField("NUMPAGES", "") works for Word and PDF but not good because it includes letter page in the count
Dim PageCount As String = "3" ' works but is hard coded, so no good
PageCount = (builder.Document.PageCount - 1).ToString ' works for Word, but does not render for PDF
Can you please advise if I am going wrong somewher or can you offer a workaround.
Many thanks for your ongoing support.