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

Free Support Forum - aspose.com

How to get Header and Footer in SlideEx?

Hello,

How can I find the header and footer of a pptx slide? I was using the following code for ppt files.

HeaderFooter dstHF = slide.getHeaderFooter(); // where slide is .ppt slide
dstHF.setHeaderVisible(true);
dstHF.setFooterVisible(true);
dstHF.setPageNumberVisible(true);
dstHF.setDateTimeVisible(true);
dstHF.setDateTimeFixed(true);
dstHF.setShowOnTitleSlide(true);

Please help.

Hi Priyank,


I like to share that there is HeaderFooterManger class in case PPTX to manage the header and footers. Please try using the following sample code to serve the purpose and share with us if there is any issue incurring.

PresentationEx sourcePres = new PresentationEx(path2 + “source.pptx”);

//Setting Header Footer visibility properties
sourcePres.setUpdateSlideNumberFields(true);
sourcePres.setUpdateDateTimeFields(true);
sourcePres.getHeaderFooterManager().isDateTimeVisible(true);
sourcePres.getHeaderFooterManager().isFooterVisible(true);
sourcePres.getHeaderFooterManager().isSlideNumberVisible(true);
sourcePres.getHeaderFooterManager().setVisibilityOnTitleSlide(true);
sourcePres.getHeaderFooterManager().setVisibilityOnTitleSlide(true);

sourcePres.write(path2+“NewSource.pptx”);

Many Thanks,

I’m trying to get headers and footers too. The code snippet shows how to SET headers and footers, is there a way to GET them as well?

Hi Duncan,


I have tried to understand the query shared by you. Can you please elaborate your requirement that by getting what actually you meant. Can you please share your requirement in the form of sample presentation and explain that. I will try my best to help you further on the basis of availability of requested information from your end.

Many Thanks,