PowerPoint 幻灯片中的备注信息是为使用者提供便利而设置的,该信息只对使用者可见。本文将向大家详细阐述如何通过Spire.Presentation for Java添加、读取和删除 PowerPoint 幻灯片中的备注信息。
注:编辑代码前,注意添加引用lib文件夹中的jar文件到程序(如下图)
示例1—添加备注到PPT:
import com.spire.presentation.*;
public class AddNotes {
public static void main(String[] args) throws Exception {
//加载PowerPoint文档
Presentation ppt = new Presentation();
ppt.loadFromFile("C:\Users\Administrator\Desktop\222.pptx");
//获取第一张幻灯片
ISlide slide = ppt.getSlides().get(0);
//添加备注幻灯片到第一张幻灯片
NotesSlide notesSlide = slide.addNotesSlide();
//添加备注标题
ParagraphEx paragraph = new ParagraphEx();
paragraph.setText("备注:")