本文将介绍如何使用spire.presentation for java给powerpoint文档添加页脚。
import com.spire.presentation.fileformat;
import com.spire.presentation.presentation;
public class addfooter {
public static void main(string[] args) throws exception {
//加载powerpoint文档
presentation presentation = new presentation();
presentation.loadfromfile("input.pptx");
//添加页脚
presentation.setfootertext("demo of spire.presentation");
//设置页脚可见
presentation.setfootervisible(true);
//设置页码可见
presentation.setslidenumbervisible(true);
//设置日期可见
presentation.setdatetimevisible(true);
//保存文档
presentation.savetofile("addfooter.pptx", fileformat.pptx_2010);
}
}
生成文档: