演示文稿备注

添加和删除幻灯片备注

Aspose.Slides 现在支持从演示文稿中删除备注幻灯片。在本主题中,我们将介绍这一新功能,移除备注以及从任何演示文稿中添加备注样式幻灯片。Aspose.Slides for C++ 提供了删除任何幻灯片备注的功能,并为现有备注添加样式。开发人员可以通过以下方式删除备注:

  • 删除演示文稿某个特定幻灯片的备注。
  • 删除演示文稿所有幻灯片的备注。

从特定幻灯片删除备注

可以如下所示删除某个特定幻灯片的备注:

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);

从所有幻灯片删除备注

可以如下所示删除演示文稿所有幻灯片的备注:

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);

添加备注样式

NotesStyle 属性已被分别添加到 IMasterNotesSlide 接口和 MasterNotesSlide 类中。此属性指定备注文本的样式。实现示例如下所示。

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);