Free Support Forum - aspose.com

PDF on footer not picking up font size

Hello,

I've got Aspose.Word and I add a footer to the document in memory. Convert it to a pdf and the formatting of the footer doesn't take effect, except for the paragragh alignment. Any ideas...?

Code:

//Add a footer to each page of the word document.

Aspose.Word.Section sect = sourceDoc.Sections[0];

Aspose.Word.HeaderFooter footer = new Aspose.Word.HeaderFooter(sourceDoc, Aspose.Word.HeaderFooterType.FooterPrimary);

sect.HeadersFooters.Add(footer);

//Now you can add some paragraphs or whatever to the footer:

Aspose.Word.Paragraph para = new Aspose.Word.Paragraph(sourceDoc);

para.ParagraphFormat.Alignment = Aspose.Word.ParagraphAlignment.Right;

para.Font.Size = 8;

para.Font.Underline = Aspose.Word.Underline.Single;

para.AppendChild(new Run(sourceDoc, footerText));

footer.AppendChild(para);

The problem is not related to PDF conversion.

The font formatting should be applied to Run object to take effect:

Paragraph para = new Paragraph(doc);

Run run = new Run(doc, "Footer Text");

run.Font.Size = 16;

run.Font.Underline = Underline.Single;

para.AppendChild(run);

footer.AppendChild(para);

para.ParagraphFormat.Alignment = ParagraphAlignment.Right;