Page numbers in generated pdf

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v5)  /  Page numbers in generated pdf

DynamicPDF CoreSuite for .NET (v5) Forum

 May 05 2009 5:33 AM
I am evaluating the DynamicPDF Merger and want to place page numbers on generated pdf. How can I do it.

Thanks
Ather Ali
 May 05 2009 6:30 AM
Posted by a ceTe Software moderator
Hello Ather Ali,

Yes, you can add the page numbers to the PDF document without any problem. You will have to use the PageNumberingLabel page element for this. You can add this element to a template and then add it to the document, this will display the page numbers in all the pages. You can refer to the PageNumberingLabel on our help documentation.

Thanks,
ceTe Software Support Team.
 May 05 2009 6:41 AM
I am using the code below but it is not working:

Dim mMergeDoc As New MergeDocument
            Dim documentTemplate As Template = New Template()
            documentTemplate.Elements.Add(New PageElements.PageNumberingLabel("%%CP%% of %%TP%%", 0, 680, 512, 12, Font.HelveticaBold, 12, TextAlign.Right))
            mMergeDoc.Template = documentTemplate
           
mMergeDoc.Append("pdfA.pdf")
mMergeDoc.Append("pdfB.pdf")
mMergeDoc.DrawToWeb("PdfReport.pdf", True)
 May 05 2009 7:19 AM
Posted by a ceTe Software moderator
Hello Ather Ali,

The Template object will be added behind the existing page elements. The PageNumberingLabel is getting added below the other page elements. This might be the reason for not seeing the page numbers. You can use the StampTemplate which adds the elements as a stamp or at the top of existing elements and this will solve your problem. Below is the sample code for this.

   mMergeDoc.StampTemplate = documentTemplate

Thanks,
ceTe Software Support Team.
 May 05 2009 7:28 AM
Thanks for prompt reply,

but it is also not working in my pdfs I have some blank pages and page number is not displaying on it as well.

Any other suggestion.

Regards,
Ather Ali
 May 05 2009 7:53 AM
Posted by a ceTe Software moderator
Hello Ather Ali,

Can you please make sure that the size of the page is sufficient to display the page numbers with the given X, Y co ordinates? If you are still having the problem then please send over the PDF files you are using to our Support Team so that they can look into it further.

Thanks,
ceTe Software Support Team.
 May 06 2009 1:49 AM
Thank you very much, I have found that the problem was co-ordinates which was going outside of the page now i can see the page numbers.

All times are US Eastern Standard time. The time now is 2:40 AM.