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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Footer issues, margins

Thread ID:





70484 Dec 12,2007 05:28 PM UTC Dec 18,2007 09:08 AM UTC WinForms 2
Tags: PDF
Asked On December 12, 2007 05:28 PM UTC


Im having some troubles with footers in a PDFDocument.

My document wide bottom margin is set to 60f.

Here is the method I am calling to create the footer:

private void AddFooter(PdfDocument doc, string footerText)
RectangleF rect = new RectangleF(0, 0, doc.Pages[0].GetClientSize().Width, 40);

//Create a page template
PdfPageTemplateElement footer = new PdfPageTemplateElement(rect);

//Set the font
Font f = new Font("Helvetica", 12);
PdfTrueTypeFont font = new PdfTrueTypeFont(f, true);

PdfSolidBrush brush = new PdfSolidBrush(Color.Black);
PdfStringFormat format = new PdfStringFormat();
format.Alignment = PdfTextAlignment.Center;
format.LineAlignment = PdfVerticalAlignment.Bottom;
format.LineLimit = false;

footer.Graphics.DrawString(footerText, font, brush, new RectangleF(0, 25, footer.Width, 40), format);

//Add the footer template at the bottom
doc.Template.Bottom = footer;

The problem is, I cannot see the footer. If i highlight the area on the PDF where the footer should be, copy, then paste the text from the footer is pasted. So the correct text is in the PDF document, its just not visible. Its asif something else (the margin maybe?) Is ontop of the footer.

If I change:

footer.Graphics.DrawString(footerText, font, brush, new RectangleF(0, 25, footer.Width, 40), format);


footer.Graphics.DrawString(footerText, font, brush, new RectangleF(0, 4, footer.Width, 40), format);

Moving the Y pos of the string to 4, this is where the bottom of the footer text is starting to be cut off.

What am i doing wrong? Is there a property of the margin, or the footer, to display all its contents? As I say, using Y pos of 25 I can highlight the footer, copy the text and this is fine so the text is in the document; its just not visible.

Thanks, any help is very much appreciated.

Best Regards,

Jisha Joy [Syncfusion]
Replied On December 14, 2007 12:07 PM UTC


I was able to see the issue of footer is not visible in PDF document . Please create a Direct-Trac incident (mention the forum link in the subject line) so that we will fix this issue and we update you with the fix.

Please let me know if you need further assistance any questions.

Thanks for using Syncfusion product.


Jisha Joy [Syncfusion]
Replied On December 18, 2007 09:08 AM UTC


Thank you for using Syncfusion Products.

On further analysis we found that this is not the issue of Pdf. If Line alignment of String Format is set, then the text will not be visible in the graphics space. This is the default behavior of .Net.

Please refer the sample in the link:

In this sample I have commented out the statement format.LineAlignment, the footer will be displayed correctly and it will be visible to the users.

Kindly try this and let me know if you need further assistance.


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

This page will automatically be redirected to the 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

Live Chat Icon For mobile
Live Chat Icon