Issues removing footers and headers from existing slides

Hello, I’m working on a issue where we need to remove footers and headers from Power Point (PPT) documents and I’m having trouble using Aspose.Slides (7.9.0.0) as well as Aspose.Slides (16.9.0.0).


With the older version:

I’m trying to enumerate the shapes using slide.Shapes and shape.Placeholder is ‘null’, shape.TextFrame.MetaCharacters is null make it difficult to detect whether the give shape is a footer or header.

slide.HeaderFooter.FooterText is always “” even when there is proper footer text in the ppt.

With new version:
Presentation ppt = new Presentation(@“E:\PowerPoint2016.ppt”);

ppt.HeaderFooterManager.SetFooterText("");
ppt.HeaderFooterManager.IsFooterVisible = false;
ppt.HeaderFooterManager.IsDateTimeVisible = false;
ppt.HeaderFooterManager.IsSlideNumberVisible = false;


foreach(ISlide s in ppt.Slides)
{
Console.WriteLine(“Slide Name: {0}”, s.Name);
foreach(IShape sh in s.Shapes)
{
if(sh.Placeholder != null)
{
Console.WriteLine(“Shape Name: {0}, Type: {1}”, sh.Name, sh.Placeholder.Type.ToString());
}
else
{
Console.WriteLine(“Shape Name: {0}, Type: null”, sh.Name);
var tf = ((AutoShape)sh).TextFrame;

}
}

Console.WriteLine("");
}

The above code results into:

Slide Name:
Shape Name: Title 1, Type: CenteredTitle
Shape Name: Subtitle 2, Type: Subtitle
Shape Name: Date Placeholder 3, Type: null
Shape Name: Footer Placeholder 4, Type: null
Shape Name: Slide Number Placeholder 5, Type: null
Slide Name:
Shape Name: Title 1, Type: Title
Shape Name: Date Placeholder 2, Type: null
Shape Name: Footer Placeholder 3, Type: null
Shape Name: Slide Number Placeholder 4, Type: null
Shape Name: Text Placeholder 5, Type: Body
*******************************************

The placeholder type is returned as null.

Note: It seems to work fine for: ppt.Masters, ppt.MasterHandoutSlideManager.MasterHandoutSlide and ppt.MasterNotesSlideManager.MasterNotesSlide. Issue with existing slide only.


Can you please suggest a way to detect the footer and header items in existing slides? Ideally in the older version.

Please let me know if any questions. thank you.

Hi,


I have observed your comments. I have shared a piece of code in a text file with you. This code will help you to achieve your requirements. Please share feedback with us if there is still an issue. Please see attachments.

Best Regards,

Hi Adnan, thank you for the response. However, I see a different behaviour here. My main issue was with PPT format. With the code sample provided, the footers are not removed from existing slides in the PPT document.


However, with PPTX its behaving slightly different. It does remove the footer, but places that text in the top left corner of the slide for some reason.

The same code is used only the paths have been changed. Please let me know how this can be fixed. We need to be able to remove the footer completely.

Please test with the file attached to the original question. thank you.

Let me know if any questions.

Update: If I apply my below changes after the sample code provided, it works for PPTX. But NOT for PPT. The issue still remains.

ppt.HeaderFooterManager.SetFooterText("");
ppt.HeaderFooterManager.IsFooterVisible = false;
ppt.HeaderFooterManager.IsDateTimeVisible = false;
ppt.HeaderFooterManager.IsSlideNumberVisible = false;
Hi,

I have worked with the presentation file using Aspose.Slides for .NET 16.9.0 and have been able to reproduce the issue. A ticket with ID SLIDESNET-37987 has been created in our issue tracking system to investigate and resolve the issue. This thread has been associated with the ticket so that we may share the notification with you once issue will be fixed.

We are sorry for your inconvenience,

thank you for the update. Will wait for next update on this issue.

Hello, Can you please let me know if there are any further updates on this issue? thanks.

Hi,


I have verified from our issue tracking system and like to share that the issue has been schedule for investigation in next week. I will be able to share the further response related to ETA after the investigation is carried.

Best Regards,

Hello, Can you please let me know if there is any update on the issue? thanks.

Hi,


I like to share that issue has been marked resolved in our issue tracking system.

Best Regards,

The issues you have found earlier (filed as SLIDESNET-37987) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan