We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to add header or footer to the presentation

Hello,


How to add header or footer as a text or as an image to the presentations.

Best regards,
Evgen

Hi Evgen,


I have observed your comments. Please follow guidelines on this link. This will help you to achieve your requirements. Please share feedback with us if there is still an issue.

Best Regards,

Thank you very much.

Hi Evgen,


You are very welcome.

Best Regards,

Hello again,


I can see that the IHeaderFooterManager interface has SetFooterText method, but how should I add the text header to the presentation? And if is it possible to add an image to the header or footer?

Best regards,
Evgen

Hi Evgen,

I have observed your requirements and like to share that the header text can only be set in NoteSlideView inside slide. For other slide views there is no header and for that reason it is not directly available in HeaderFooterManger. However, you can still set the header text but in NotesSlideView using following sample code. I hope this will help you.

public static void ManageHeader()
{
String path=@“C:\Aspose Data”;
Presentation presentation = new Presentation(path + “handout_header_footer.pptx”);

IMasterHandoutSlide masterHandoutSlide = presentation.MasterHandoutSlideManager.MasterHandoutSlide;
if (masterHandoutSlide != null)
updateHeaderFooterText(masterHandoutSlide);

IMasterNotesSlide masterNotesSlide = presentation.MasterNotesSlideManager.MasterNotesSlide;
if (null != masterNotesSlide)
updateHeaderFooterText(masterNotesSlide);

foreach(ISlide slide in presentation.Slides)
{
INotesSlide notesSlide = slide.NotesSlideManager.NotesSlide;
if (null != notesSlide)
updateHeaderFooterText(notesSlide);
}

presentation.Save(path + “handout_test.pptx”, SaveFormat.Pptx);
}

public static void updateHeaderFooterText(IBaseSlide master)
{
foreach (IShape shape in master.Shapes)
{
if (shape.Placeholder != null)
{
if (shape.Placeholder.Type == PlaceholderType.Header)
((IAutoShape)shape).TextFrame.Text=“HI there new header”;

if (shape.Placeholder.Type == PlaceholderType.Footer)
((IAutoShape)shape).TextFrame.Text=“HI there new footer”;
}
}
}

Many Thanks,

Hello,


Thank you for your answer.

Could you please help me with another question? How to add watermark to the presentations. I will appreciate your help.

Best regards,
Evgen

Hi Evgen,


I like to share that Aspose. Slides offers the property of shapes locking that you can use for adding watermark. Please visit this thread link for your kind reference. I also like to add that you can even add image as watermark and use the shape locking feature to set that as watermark on your presentation. Please visit this documentation link to see how to add the images inside the shapes.

Best Regards,

Thank you for your answer.


I can not find how to delete the shapes that was created as watermark, because I can not understand how to get correct shapes.

Could you please help.

Best regards,
Evgen

Hi Evgen,


I have observed your comments. Please follow guidelines on this link. This will help you to find shapes in slides. Please share feedback with us if there is still an issue.

Best Regards,
Hello,

Thank you for your answer.

How to merge several .pptx presentations to one new presentation? Should I use ISlides class and addClone method or there is another simple method ?

Best regards,
Evgen

Hi Evgen,


I have observed your comments. You can use cloning feature for merging presentations. Please follow guidelines on this link to achieve requirements. Please share feedback with us if there is still an issue.

Best Regards,