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. Image for the cookie policy date
close icon

Page numbers in PDFLogicDocument

I have some code which creates a PDF using the Flow model. I am able to successfully add a footer to the pages in the PDF, however, I cannot find anyway to add a page number to the footer.

It looks like the "#p;" is only supported by the TemplateArea functionality in the Grid model. Is there an equivilant in the Flow model? Or, just someway of adding page numbers using the Flow model?

Thanks.

3 Replies

AD Administrator Syncfusion Team December 5, 2006 03:57 PM UTC

Hi kfranzen,

We do have support for add the page number in Flow model too, in which the page no can be added easily inside PDFTemplateArea using #p.

Code snippet (C#)
-----------------------
PDFTemplateArea template = ldoc.Areas.Add( new RectangleF(0,600,610,250));
TextShape txtShape = template.Canvas.AddText("Page #p; of the #P; pages");

Here is a sample for your reference.
PageNo(Flowmodel).zip

Could you please take a look at this and let me know if you have any other queries.

Regards,
Prakash.


AD Administrator Syncfusion Team December 5, 2006 05:56 PM UTC

Prakash,
Thanks, that did the trick.

I do have one question. The PDFTemplateArea for the footer is added to the document not to a section. Yet in the code you posted a second PDFTemplateArea is added after the second Section is added to the document. Is this really necessary?

My code only has one section at the moment, but I would like to know for the future?

Thanks.


AD Administrator Syncfusion Team December 7, 2006 12:33 AM UTC

Hi kfranzen,

It is not necessary to add the page footer to every section since we add it to the document directly. Its enough to add footer only once and the page footer will be added whenever we the new page is created.

Please let me know if you have any other queries.

Regards,
Prakash.









Loader.
Live Chat Icon For mobile
Up arrow icon