The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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?
ADAdministrator Syncfusion Team 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.
[C#]
//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\5.2.0.25\Windows\...\HeadersAndFooters
Please let us know if this helps you.
Thank you for your interest in Syncfusion products.