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

To Center Elements (PdfPageNumberField , ...)

Thread ID:





69127 Oct 16,2007 08:42 AM UTC Oct 27,2007 07:31 AM UTC ASP.NET Web Forms (Classic) 1
Tags: PDF
Administrator [Syncfusion]
Asked On October 16, 2007 08:42 AM UTC

Hi Syncfusion.com-Team

Is there any way to center the PdfPageNumberField or the PdfPageCountField?

I expected to get the values of the PdfPageNumberField in the
PageAdded-Event, but there is no such Property!
(comparing your documentation?!?)
Your Library does not support to nest the PdfElements?
Why not?
Or is there any Interface i have overlooked?

My first workaround was to create a DataTable with 3 Columns:
left, pagenumber
center, \
right, pagecount

But the values seems to be generated on the clientside?
Is this correct?

Administrator [Syncfusion]
Replied On October 27, 2007 07:31 AM UTC

Hi Frank,

Sorry for the delayed response.

If your intention is to center the PdfPageNumberField , then you can control its location while drawing the footer string in the PDF document using PdfCompositeField.

The following code snippet illustrates this.


//Create page number field
PdfPageNumberField pageNumber = new PdfPageNumberField();

//Create page count field
PdfPageCountField count = new PdfPageCountField(font, brush);

// Draw the footer
PdfCompositeField compositeField = new PdfCompositeField(font, brush, "Page {0} of {1}", pageNumber, count);
compositeField.Bounds = footer.Bounds;
compositeField.Draw(footer.Graphics, new PointF(270, 40));

Please refer the sample that shipped with Essential studio in the below location.

[Install drive]:\Documents and Settings\UserName\My Documents\Syncfusion\EssentialStudio\\Windows\...\HeadersAndFooters

Please let us know if this helps you.

Thank you for your interest in Syncfusion products.



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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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