Interface IHeaderFooter
Represents a header, footer, date and time, slide number on a slide or master.
Namespace: Syncfusion.Presentation
Assembly: Syncfusion.Presentation.UWP.dll
Syntax
public interface IHeaderFooter
Remarks
All the IHeaderFooter objects for a slide or master are contained in a IHeadersFooters object.
Properties
Format
Gets or sets a date and time format of Date placeholder for the specified slide.
Declaration
DateTimeFormatType Format { get; set; }
Property Value
Type |
---|
DateTimeFormatType |
Remarks
Used to represent DateTimeFormat of a Date placeholder and will not valid for Header, Footer and SlideNumber placeholders.
Examples
//Creates an instance of Presentation
IPresentation pptxDoc = Presentation.Create();
//Adds a blank slide.
ISlide slide = pptxDoc.Slides.Add(SlideLayoutType.Blank);
//Sets the visibility of Date and Time in the slide
slide.HeadersFooters.DateAndTime.Visible = true;
//Gets the DateTime header footer of the slide.
IHeaderFooter headerFooter = slide.HeadersFooters.DateAndTime;
//Sets the format of the Date and Time to the Footer
headerFooter.Format = DateTimeFormatType.DateTimehmmAMPM;
//Add an auto shape to slide
slide.Shapes.AddShape(AutoShapeType.Rectangle, 100, 100, 250, 250);
//Saves the Presentation to the file system
pptxDoc.Save("Sample.pptx");
//Closes the Presentation
pptxDoc.Close();
'Creates an instance of Presentation
Dim pptxDoc As IPresentation = Presentation.Create()
'Adds a blank slide
Dim slide As ISlide = pptxDoc.Slides.Add(SlideLayoutType.Blank)
'Sets the visibility of Date and Time in the slide
slide.HeadersFooters.DateAndTime.Visible = True
'Gets the DateTime header footer of the slide.
Dim headerFooter As IHeaderFooter = slide.HeadersFooters.DateAndTime
'Sets the format of the Date and Time to the Footer
headerFooter.Format = DateTimeFormatType.DateTimehmmAMPM
'Add an auto shape to slide
slide.Shapes.AddShape(AutoShapeType.Rectangle, 100, 100, 250, 250)
'Saves the Presentation to the file system
pptxDoc.Save("Sample.pptx")
'Closes the Presentation
pptxDoc.Close()
Text
Gets or sets a text from IHeaderFooter object for the specified slide.
Declaration
string Text { get; set; }
Property Value
Type |
---|
System.String |
Remarks
If sets a value to Text property of DateAndTime or SlideNumber, it will be displayed as fixed text.
Examples
//Creates an instance of Presentation
IPresentation pptxDoc = Presentation.Create();
//Adds a blank slide.
ISlide slide = pptxDoc.Slides.Add(SlideLayoutType.Blank);
//Sets the visibility of Footer content in the slide
slide.HeadersFooters.Footer.Visible = true;
//Gets the footer of the slide.
IHeaderFooter footer = slide.HeadersFooters.Footer;
//Sets the text to be added to the Footer
footer.Text = "Footer content";
//Add an auto shape to slide
slide.Shapes.AddShape(AutoShapeType.Rectangle, 100, 100, 250, 250);
//Saves the Presentation to the file system
pptxDoc.Save("Sample.pptx");
//Closes the Presentation
pptxDoc.Close();
'Creates an instance of Presentation
Dim pptxDoc As IPresentation = Presentation.Create()
'Adds a blank slide
Dim slide As ISlide = pptxDoc.Slides.Add(SlideLayoutType.Blank)
'Sets the visibility of Footer content in the slide
slide.HeadersFooters.Footer.Visible = True
'Gets the footer of the slide.
Dim footer As IHeaderFooter = slide.HeadersFooters.Footer
'Sets the text to be added to the Footer
footer.Text = "Footer content"
'Add an auto shape to slide
slide.Shapes.AddShape(AutoShapeType.Rectangle, 100, 100, 250, 250)
'Saves the Presentation to the file system
pptxDoc.Save("Sample.pptx")
'Closes the Presentation
pptxDoc.Close()
Visible
Gets or sets the visibility of IHeaderFooter object for the specified slide.
Declaration
bool Visible { get; set; }
Property Value
Type |
---|
System.Boolean |
Remarks
Visibility of HeaderFooter is only applied, when specified HeaderFooter is exist in parent slide.
Examples
//Creates an instance of Presentation
IPresentation pptxDoc = Presentation.Create();
//Adds a blank slide.
ISlide slide = pptxDoc.Slides.Add(SlideLayoutType.Blank);
//Gets the footer of the slide.
IHeaderFooter footer = slide.HeadersFooters.Footer;
//Sets the visibility of Footer content in the slide
footer.Visible = true;
//Sets the text to be added to the Footer
footer.Text = "Footer content";
//Add an auto shape to slide
slide.Shapes.AddShape(AutoShapeType.Rectangle, 100, 100, 250, 250);
//Saves the Presentation to the file system
pptxDoc.Save("Sample.pptx");
//Closes the Presentation
pptxDoc.Close();
'Creates an instance of Presentation
Dim pptxDoc As IPresentation = Presentation.Create()
'Adds a blank slide
Dim slide As ISlide = pptxDoc.Slides.Add(SlideLayoutType.Blank)
'Gets the footer of the slide.
Dim footer As IHeaderFooter = slide.HeadersFooters.Footer
'Sets the visibility of Footer content in the slide
footer.Visible = True
'Sets the text to be added to the Footer
footer.Text = "Footer content"
'Add an auto shape to slide
slide.Shapes.AddShape(AutoShapeType.Rectangle, 100, 100, 250, 250)
'Saves the Presentation to the file system
pptxDoc.Save("Sample.pptx")
'Closes the Presentation
pptxDoc.Close()