Cant add footer on version "Aspose.Slides Version 14.2.0"

I try to add footer in a slide
I try to follow example code


IHeaderFooterManager srcHF = pres.getHeaderFooterManager();
srcHF.isFooterVisible(true);
srcHF.setFooterText(“Footer Text”);

but getHeaderFooterManager method does not exist on latest build.

Is there any workaround?

Hi Vimalraj,


Thank you for your interest in Aspose.Slides.

I have observed your comments and worked over your requirements. I request you to please try using Aspose.Slides for Java 15.6.0 on your end as this is working fine on this latest available version. Please try using following sample code on your end to serve the purpose.

pres.getHeaderFooterManager().setFooterText(“My Footer text”);
pres.getHeaderFooterManager().setFooterVisible(true);

Please let us know if the issue persists. We will be happy to assist you further.

Best Regards,

Hi,


I am working on SharePoint tool and i need to develop application based on C#.

the below shared code is not working for me.

pres.getHeaderFooterManager().setFooterText(“My Footer text”);
pres.getHeaderFooterManager().setFooterVisible(true);

Please let me know how to resolve this issue.

Regards,
Vimalraj

Hi Vimalraj,


Thank you for getting back to us.

The code I have shared with you earlier was for Aspose.Slides for Java and this ambiguity happened because of the code you have shared with us in your very first post and you did not select any platform while making the post. Please make sure you select the platform while making a new post. Below is the code which works with Aspose.Slides for .NET. Please try using this sample code on your end and then share your valuable feedback with us.

Presentation pres = new Presentation(@“D:\test.pptx”);
pres.HeaderFooterManager.SetFooterText(“My Footer text”);
pres.HeaderFooterManager.IsFooterVisible = true;
pres.Save(@“D:\FooterNet.pptx”, Aspose.Slides.Export.SaveFormat.Pptx);
Please let us know if the issue persists. We will be happy to assist you further.

Best Regards,

Hi ,


Thanks for the code, it worked for me.

Please also let me know to apply color for the footer and DateTime context in PPT on the same.

Regards,
Vimalraj V

Hi Vimalraj,


I have observed your comments and like to request you to please try using following sample code on your end to serve the purpose.

Presentation pres = new Presentation(@“D:\test.pptx”);
ISlideCollection slidesColl = pres.Slides;
if (slidesColl.Count > 0)
{
foreach (ISlide slide in slidesColl)
{
IParagraph para;
foreach (IShape shape in slide.Shapes)
{
if (shape.Placeholder != null && ((shape.Placeholder.Type == PlaceholderType.Footer) || (shape.Placeholder.Type == PlaceholderType.DateAndTime)))
{
Aspose.Slides.ITextFrame Holder = ((Aspose.Slides.IAutoShape)shape).TextFrame;
IPortion port = null;
para = new Paragraph();
para = Holder.Paragraphs[0];
port = para.Portions[0];

//Set Italic property of the Font
port.PortionFormat.FontItalic = NullableBool.True;

//Set Height of the Font
port.PortionFormat.FontHeight = 25;

//Set the Color of the Font
port.PortionFormat.FillFormat.FillType = FillType.Solid;
port.PortionFormat.FillFormat.SolidFillColor.Color = Color.Blue;

pres.Save(@“D:\test.pptx”, Aspose.Slides.Export.SaveFormat.Pptx);
}
}
}
}

I hope this will be helpful. Please share if I may help you further in this regard.

Best Regards,

Hi,


Thanks for the support, the above code worked for me.:slight_smile:

Regards,
Vimalraj

Hi Vimalraj,


Thank you for your valuable feedback.

We are glad to hear that, things have started working on your end. Please feel free to contact us if we could be of any help to you.

Best Regards,