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.
Unfortunately, activation email could not send to your email. Please try again.

Footer Not Showing

Thread ID:

Created:

Updated:

Platform:

Replies:

74893 Jul 2,2008 10:11 AM Jul 3,2008 04:34 AM ASP.NET Web Forms (Classic) 1
loading
Tags: PDF
Daaron Dwyer
Asked On July 2, 2008 10:11 AM

My company is using 5.102.0.51, and when using your demo code, if I remove the page numbering item (#p;), the footer does not print.

Sample code:
public void FooterIssue()
{
PDFDocument _pdfDocument = new PDFDocument();
_pdfDocument.Compression = CompressionLevel.Best;
_pdfDocument.FileFormat = FileFormat.Format1_4;
_pdfDocument.Properties.Producer = "MyLeo";
_pdfDocument.Margins.Bottom = 50f;
_pdfDocument.AutoCreatePages = true;

IPDFFont font = _pdfDocument.Fonts.Add(FontBaseFamily.Helvetica);
font.Size = 12;

//Set properties for template box
IPDFGraphicState templateProps = _pdfDocument.CreateGraphicState();
templateProps.BackColor = new PDFColor(Color.White);

//IPDFGraphicState is used for setting properties of all drawing objects.
IPDFGraphicState props = _pdfDocument.CreateGraphicState();
props.BreakBehavior = AutoBreakBehavior.MultiLineTextBreak;

SizeF sizer = new SizeF(_pdfDocument.LastPage.DrawingWidth, 40);

PDFTemplateArea header = _pdfDocument.Templates.Add(sizer);
header.Graphics.DrawMultiText(new PointF(0, 0), sizer, "Header " + DateTime.Now.ToLongTimeString(), font, props);
_pdfDocument.Templates.Header = header;

// THIS WORKS
//AddFooter(_pdfDocument, "Something #p;");
//_pdfDocument.Save(@"D:\Projects\MyLeo\build\temp\footertest_with.pdf");

// THIS DOESN'T
AddFooter(_pdfDocument, "Something");
_pdfDocument.Save(@"D:\Projects\MyLeo\build\temp\footertest_without.pdf");
}

private void AddFooter(PDFDocument doc, string FooterText)
{
PDFTemplateArea footer = doc.Templates.Add(new SizeF(
doc.LastPage.DrawingWidth, 40));

IPDFFont font = doc.Fonts.Add(FontBaseFamily.HelveticaBold);
font.Size = 10;
string text = FooterText;
SizeF size = footer.Graphics.MeasureString(text, font);
RectangleF bounds = new RectangleF(0, 15,
footer.Size.Width, footer.Size.Height);
IPDFGraphicState props = doc.CreateGraphicState();
props.TextAlignment = TextAlignment.Right;
props.BreakBehavior = AutoBreakBehavior.Cropping;

footer.Graphics.DrawMultiText(bounds, text, font, props);

doc.Templates.Footer = footer;
}


Sri Subhashini M [Syncfusion]
Replied On July 3, 2008 04:34 AM

Hi,

Thank you for using Syncfusion product.

Footer is not displaying properly.

The issue which is mentioned here is a defect, but the issue got fixed in the version 5.2.0.25. I would like to recommend you to upgrade to the version 5.2.0.25. You can download Essential Studio PDF 5.2.0.25 version from the below thread:

http://www2.syncfusion.com/installs/v5.2.0.25/syncfusionessentialstudiosetup.exe

Unlock key :

If your Essential Studio license is current, you will be able to obtain the key to install this version from your account in DirectTrac. Otherwise please contact your Syncfusion Sales Representative or e-mail salessupport@syncfusion.com.

Please let me know if you need any further assistance.

Regards,
Suba


CONFIRMATION

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.

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.

;