Add Header and Footer in PowerPoint Presentations using Java

Header and footer in PowerPoint presentations are used to display additional information such as slide number, author, date, etc. In this article, you will learn how to add and manage the header and footer in PowerPoint PPTX/PPT presentations programmatically using Java.

In order to work with header and footer in PowerPoint presentations, we will use Aspose.Slides for Java. It is a feature-rich API that lets you create and manipulate PowerPoint and OpenOffice documents. You can either download the API’s JAR or install it via Maven.

<repository>
    <id>AsposeJavaAPI</id>
    <name>Aspose Java API</name>
    <url>http://repository.aspose.com/repo/</url>
</repository>
<dependency>
    <groupId>com.aspose</groupId>
    <artifactId>aspose-slides</artifactId>
    <version>21.9</version>
    <classifier>jdk16</classifier>
</dependency>

The following are the steps to add header and footer in a PowerPoint presentation using Java.

The following code sample shows how to add header and footer in a PowerPoint presentation.

Aspose.Slides for Java also allows you to set the header and footer in handout and notes slides. For this, you can either apply changes in master notes slide or an individual slide. The following sections cover both scenarios.

The following code sample shows how to change header and footer in notes master using Java.

The following code sample shows how to change header and footer in notes slides using Java.

Get a Free API License

Get a free temporary license to use Aspose.Slides for Java without evaluation limitations.

Conclusion

In this article, you have learned how to add header and footer in PowerPoint presentations using Java. Moreover, you have seen how to change header and footer in notes slides programmatically. Besides, you can explore the documentation to learn more about Aspose.Slides for Java. Also, you can ask your questions via our forum.

See Also