備註
Contents
[
Hide
]
本文示範如何使用 Aspose.Slides for Android via Java 新增、讀取、移除以及更新備註投影片。
新增備註投影片
建立備註投影片並為其指派文字。
static void addNote() {
Presentation presentation = new Presentation();
try {
ISlide slide = presentation.getSlides().get_Item(0);
INotesSlide notesSlide = slide.getNotesSlideManager().addNotesSlide();
slide.getNotesSlideManager().getNotesSlide().getNotesTextFrame().setText("My note");
} finally {
presentation.dispose();
}
}
存取備註投影片
從現有的備註投影片讀取文字。
static void accessNote() {
Presentation presentation = new Presentation();
try {
ISlide slide = presentation.getSlides().get_Item(0);
INotesSlide notesSlide = slide.getNotesSlideManager().addNotesSlide();
String notes = notesSlide.getNotesTextFrame().getText();
} finally {
presentation.dispose();
}
}
移除備註投影片
移除與投影片關聯的備註投影片。
static void removeNote() {
Presentation presentation = new Presentation();
try {
ISlide slide = presentation.getSlides().get_Item(0);
INotesSlide notesSlide = slide.getNotesSlideManager().addNotesSlide();
slide.getNotesSlideManager().removeNotesSlide();
} finally {
presentation.dispose();
}
}
更新備註文字
變更備註投影片的文字。
static void updateNoteText() {
Presentation presentation = new Presentation();
try {
ISlide slide = presentation.getSlides().get_Item(0);
INotesSlide notesSlide = slide.getNotesSlideManager().addNotesSlide();
slide.getNotesSlideManager().getNotesSlide().getNotesTextFrame().setText("Old");
slide.getNotesSlideManager().getNotesSlide().getNotesTextFrame().setText("Updated");
} finally {
presentation.dispose();
}
}