Today I will show you how to insert a footer in Powerpoint in Java. You can easily insert footers into Powerpoint using a library called Spire.Presentation for Java.
1. From the official website of E-iceblue Free Spire. Presentation for Java Download the free version.
2. Launch the IDE to create a new project, then add the appropriate Spire. Presentation.jar to the reference that was in the installed file.
public class AddFooter { public static void main(String[] args) throws Exception {
//Load the PowerPoint document. Presentation presentation = new Presentation(); presentation.loadFromFile("Input.pptx");
//Insert the footer.
presentation.setFooterText("It's a footer");
//Display the footer.
presentation.setFooterVisible(true);
//Display the page number.
presentation.setSlideNumberVisible(true);
//Display the date.
presentation.setDateTimeVisible(true);
//you save.
presentation.saveToFile("AddFooter.pptx", FileFormat.PPTX_2010);
}
}
<h4> <strong> Execution result </strong> </h4>
<p><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/l/lendoris/20210120/20210120155822.png " alt="f:id:lendoris:20210120155822p:plain" title="" class="hatena-fotolife" itemprop="image" /></p>
<p> </p>
Recommended Posts