Hello,
How to add header or footer as a text or as an image to the presentations.
Best regards,
Evgen
Hello,
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,
Hello again,
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”;
}
}
}
Hello,
Hi Evgen,
Thank you for your answer.
Hi Evgen,
Hi Evgen,