unable to get the page numbers

hi, am unable to get the page number with "#p;". It was fine if I generate document with Grid model, but it was not with Flow model. And, one more is how to get the total number of pages. I want to display for each page like "Page 1 of n, page 2 of n, ......" Thanks in advance, Sharat.

4 Replies

AJ Ajish Syncfusion Team July 4, 2006 12:13 PM UTC

Hi Sharat, Thank you for your interest in Essential PDF. 1) In Grid model to get page number of the current page use #p; and to get the total number of pages you can use #P; Here is the sample which does the above and displays footer with Page X of Y format: GridModel.zip You can also get the total page number using the following code. doc.pages.count; 2) You can get the page number in flow model too using #p; and #P; Here is a sample for doing this in flow model: FlowModelSample.zip However please note that the #p; symbolic representation has its limitation it can only be used with TemplateArea. Please take a look and let me know if you have any other questions. Thanks, Ajish.


SB Sharat Babu July 4, 2006 01:25 PM UTC

Hi Ajish, Thanks for your response, it was working fine with TemplateArea. Thanks, Sharat. >Hi Sharat, > >Thank you for your interest in Essential PDF. > >1) In Grid model to get page number of the current page use #p; and to get the total number of pages you can use #P; > >Here is the sample which does the above and displays footer with Page X of Y format: GridModel.zip > >You can also get the total page number using the following code. > >doc.pages.count; > >2) You can get the page number in flow model too using #p; and #P; > >Here is a sample for doing this in flow model: FlowModelSample.zip > >However please note that the #p; symbolic representation has its limitation it can only be used with TemplateArea. > >Please take a look and let me know if you have any other questions. > >Thanks, >Ajish.


RR Robert Rhoden July 21, 2006 06:47 PM UTC

Does #p; and #P; also work in Visual Basic? I have tried to do this and it just shows a blank space where the page numbers should be.

>Hi Sharat,
>
>Thank you for your interest in Essential PDF.
>
>1) In Grid model to get page number of the current page use #p; and to get the total number of pages you can use #P;
>
>Here is the sample which does the above and displays footer with Page X of Y format: GridModel.zip
>
>You can also get the total page number using the following code.
>
>doc.pages.count;
>
>2) You can get the page number in flow model too using #p; and #P;
>
>Here is a sample for doing this in flow model: FlowModelSample.zip
>
>However please note that the #p; symbolic representation has its limitation it can only be used with TemplateArea.
>
>Please take a look and let me know if you have any other questions.
>
>Thanks,
>Ajish.


AJ Ajish Syncfusion Team July 21, 2006 07:00 PM UTC

Hi Robert,

The Symbolic constants #p; and #P; to display page numbers will work on VB.Net applications too. However note that the #p; symbolic representation has its limitation it can only be used with TemplateArea.

Here is a sample for your reference:
Page Numbers.zip


Please take a look and let me know if you have any questions.

Thanks,
Ajish.

Loader.
Up arrow icon