We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Print page number as ''Page X of Y'' in document templates.

Thread ID:

Created:

Updated:

Platform:

Replies:

75672 Aug 6,2008 02:50 AM UTC Aug 7,2008 08:23 AM UTC General Discussion 3
loading
Tags: General Discussion
Administrator [Syncfusion]
Asked On August 6, 2008 02:50 AM UTC

Hi,

If we print/privew by using douument templates, How can we display page numbers as 'Page X of Y' where 'X' is a page number and 'Y' is total number of pages?

Thanks
-Kishan


Bhuvaneswari P [Syncfusion]
Replied On August 6, 2008 09:51 AM UTC

Hi Kishan,

Thank you for your interest in Syncfusion products.

It is possible to print page number and total number of pages in the document using the FieldPage and FieldNumPages. Please refer the below code snippet to do so:

[C#]

WParagraph footerPar = new WParagraph(doc);
// Add page and Number of pages field to the document.
footerPar.AppendText("Page ");
//To insert page number
footerPar.AppendField("Page", FieldType.FieldPage);
footerPar.AppendText(" of ");
//To insert total number of pages
footerPar.AppendField("Y", FieldType.FieldNumPages);
section1.HeadersFooters.Footer.Paragraphs.Add(footerPar);


Here is the simple sample for your reference:
'>http://websamples.syncfusion.com//samples/DocIO.Windows/F75972/main.htm">
http://websamples.syncfusion.com//samples/DocIO.Windows/F75972/main.htm

Please try this and let us know if this helps you.

Best Regards,
Bhuvana




Administrator [Syncfusion]
Replied On August 6, 2008 11:17 AM UTC

Hi Bhuvana,

Thanks for quick reply.
I am using syncfusion 5.1.1.47
I want print/priview page number as 'Page X of Y' using GridPrintDocument.

Can this behaviour acheived through PrintDocument?

Thanks
-Kishan


Sri Rajan [Syncfusion]
Replied On August 7, 2008 08:23 AM UTC

Hi Kishan,

Thank you for your interest in Syncfusion products.

Please refer the below Kb Article which deals with how to print page numbers as 'Page X of Y' using GridPrintDocument and let me know if this helps.

http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=62

Best Regards,
Srirajan.



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;