Page 1 of 1

Page count

PostPosted: April 17th, 2009, 6:50 pm
by bswift
OK....I thought I had a soultion for the page count to add to the printed page like this:
Format('Page %d of %d: '+sn, [TotalPages+1, PagesCount]));

I was using some other code that I won't bore you with to get the page count because it was not working correctly. I know for sure I can get the page count from a little bit of hacked code in Preview.pas. How can I add that to the pages using something other thah NewPage proc??

I'm stumpted.....

Thanks,

b

Re: Page count

PostPosted: April 17th, 2009, 7:47 pm
by Kambiz
The TotalPages property updates when a page is added to the page list.

Inside BeginDoc/EndDoc block you can only use NewPage to add a new page. However, outside BeginDoc/EndDoc, you can use BeginInsert/EndInsert block to add a new page.