Presentation Notes
Add and Remove Slide Notes
Aspose.Slides now supports removing notes slides from presentation. In this topic, we will introduce this new feature of removing Notes also adding notes style slides from any presentation. Aspose.Slides for C++ provides the feature of removing notes of any slide as well as add style to existing notes. Developers can remove notes in following ways:
- Removing Notes of a Specific Slide of a presentation.
- Removing Notes of All Slides of a Presentation.
Remove Notes from Specific Slide
Notes of some specific slide could be removed as shown in example below:
For complete examples and data files, please go to https://github.com/aspose-slides/Aspose.Slides-for-C | |
// The path to the documents directory. | |
const String templatePath = u"../templates/AccessSlides.pptx"; | |
const String outPath = u"../out/RemoveNotesAtSpecificSlide.pptx"; | |
// Instantiate Presentation class | |
SharedPtr<Presentation>pres = MakeObject<Presentation>(templatePath); | |
// Removing notes of all slides | |
SharedPtr<INotesSlideManager> mgr; | |
//Removing notes from first slide | |
mgr = pres->get_Slides()->idx_get(0)->get_NotesSlideManager(); | |
mgr->RemoveNotesSlide(); | |
// Save presentation to disk | |
pres->Save(outPath, Aspose::Slides::Export::SaveFormat::Pptx); |
Remove Notes from all Slides
Notes of all the slides of a presentation could be removed as shown in example below:
For complete examples and data files, please go to https://github.com/aspose-slides/Aspose.Slides-for-C | |
// The path to the documents directory. | |
const String templatePath = u"../templates/AccessSlides.pptx"; | |
const String outPath = u"../out/RemovedAllNotes.pptx"; | |
// Instantiate Presentation class | |
SharedPtr<Presentation>pres = MakeObject<Presentation>(templatePath); | |
// Removing notes of all slides | |
SharedPtr<INotesSlideManager> mgr ; | |
for (int i = 0; i < pres->get_Slides()->get_Count(); i++) | |
{ | |
mgr = pres->get_Slides()->idx_get(i)->get_NotesSlideManager(); | |
mgr->RemoveNotesSlide(); | |
} | |
// Save presentation to disk | |
pres->Save(outPath, Aspose::Slides::Export::SaveFormat::Pptx); |
Add NotesStyle
NotesStyle property has been added to IMasterNotesSlide interface and MasterNotesSlide class respectively. This property specifies the style of a notes text. The implementation is demonstrated in the example below.
For complete examples and data files, please go to https://github.com/aspose-slides/Aspose.Slides-for-C | |
// The path to the documents directory. | |
const String outPath = u"../out/AddNotesSlideWithNotesStyle_out.pptx"; | |
const String templatePath = u"../templates/AccessSlides.pptx"; | |
SharedPtr<Presentation> pres = MakeObject<Presentation>(templatePath); | |
//Accessing Master note slide | |
SharedPtr<IMasterNotesSlide> notesMaster = pres->get_MasterNotesSlideManager()->get_MasterNotesSlide(); | |
if (notesMaster != NULL) | |
{ | |
// Get MasterNotesSlide text style | |
SharedPtr<ITextStyle> notesStyle = notesMaster->get_NotesStyle(); | |
//Set symbol bullet for the first level paragraphs | |
SharedPtr<IParagraphFormat> paragraphFormat = notesStyle->GetLevel(0); | |
paragraphFormat->get_Bullet()->set_Type(BulletType::Symbol); | |
} | |
pres->Save(outPath, Aspose::Slides::Export::SaveFormat::Pptx); |