PowerPoint 演示文稿 处理图像

目录编排是逻辑分组相关项目的好方法,正如我们熟悉使用文件夹来组织相关文件一样,因此可以选择类似的方法使用章节将幻灯片组织成有意义的组。它还为您提供了灵活性,您可以为每位同事分配一个章节,以在协作期间明确幻灯片的归属。如果您从一个空白的状态开始,可以使用章节来概述您的演示文稿。通常,章节设计用于大型演示文稿,这些演示文稿包含大量幻灯片,可以轻松分组为逻辑分组,因为这样使您的演示文稿更易于导航。此外,章节可以在幻灯片导航窗格中折叠或展开,并命名以便于参考。

在我们进一步进行之前,我们需要安装 Aspose.Slides Cloud SDK for .NET,最简单的方法是通过 NuGet 包,在包管理器控制台中使用以下命令:

Install-Package Aspose.Slides-Cloud -Version 21.2.0 

一旦安装完成,下一步就是获取认证凭据,以便您可以轻松安全地使用我们的 API。有关更多详细信息,请访问

部分管理

Aspose.Slides Cloud 提供了以下功能:

获取现有演示部分

请求 URL

GET https://api.aspose.cloud/v3.0/slides/myPresentation.pptx/sections?folder=myFolder

C#.NET

string MyAppKey = "xxxxxxxx";    // Get AppKey and AppSID from https://dashboard.aspose.cloud/
string MyAppSid = "xxxxxxxx";    // Get AppKey and AppSID from https://dashboard.aspose.cloud/

SlidesApi api = new SlidesApi("MyAppSid", "MyAppKey");
GetSectionsRequest request = new GetSectionsRequest
{
    Name = "myPresentaion.pptx",
    Folder = "myFolder"
};
Sections sections = api.GetSections(tequest);
Console.WriteLine(sections.SectionList.Count);

设置 PowerPoint 部分

请求 URL

PUT https://api.aspose.cloud/v3.0/slides/myPresentation.pptx/sections?folder=myFolder

请求体

{ "sectionList": [{ "name": "Section1", "firstSlideIndex": 1 }, { "name": "Section2", "firstSlideIndex": 4 }]}

C#.NET

string MyAppKey = "xxxxxxxx";    // Get AppKey and AppSID from https://dashboard.aspose.cloud/
string MyAppSid = "xxxxxxxx";    // Get AppKey and AppSID from https://dashboard.aspose.cloud/

SlidesApi api = new SlidesApi("MyAppSid", "MyAppKey");
Sections dto = new Sections
{
    SectionList = new List<Section>
    {
        new Section { Name = "Section1", FirstSlideIndex = 1 },
        new Section { Name = "Section2", FirstSlideIndex = 4 }
    }
};
PutSectionsRequest request = new PutSectionsRequest
{
    Name = "myPresentaion.pptx",
    Folder = "myFolder",
    Sections = dto
};
Sections sections = api.PutSections(request);
Console.WriteLine(sections.SectionList.Count); //2
Console.WriteLine(sections.SectionList[0].SlideList.Count); //3

创建新章节

请求 URL

POST https://api.aspose.cloud/v3.0/slides/myPresentation.pptx/sections?folder=myFolder&sectionName=NewSection&slideIndex=4

C#.NET

string MyAppKey = "xxxxxxxx";    // Get AppKey and AppSID from https://dashboard.aspose.cloud/
string MyAppSid = "xxxxxxxx";    // Get AppKey and AppSID from https://dashboard.aspose.cloud/

SlidesApi api = new SlidesApi("MyAppSid", "MyAppKey");
PostSectionRequest request = new PostSectionRequest
{
    Name = "myPresentaion.pptx",
    Folder = "myFolder",
    SectionName = "NewSection",
    SlideIndex = 4
};
Sections sections = api.PostSection(request);
Console.WriteLine(sections.SectionList.Count);

更改章节名称

请求 URL

PUT https://api.aspose.cloud/v3.0/slides/myPresentation.pptx/sections/2?folder=myFolder&sectionName=UpdatedSection

C#.NET

string MyAppKey = "xxxxxxxx";    // Get AppKey and AppSID from https://dashboard.aspose.cloud/
string MyAppSid = "xxxxxxxx";    // Get AppKey and AppSID from https://dashboard.aspose.cloud/

SlidesApi api = new SlidesApi("MyAppSid", "MyAppKey");
PutSectionRequest request = new PutSectionRequest
{
    Name = "myPresentaion.pptx",
    Folder = "myFolder",
    SectionName = "UpdatedSection",
    SectionIndex = 2
};
Sections sections = api.PutSection(request);
Console.WriteLine(sections.SectionList[1].Name); //UpdatedSection

移动部分和幻灯片到其他位置

请求 URL

POST https://api.aspose.cloud/v3.0/slides/myPresentation.pptx/sections/1/move?folder=myFolder&newPosition=2

C#.NET

string MyAppKey = "xxxxxxxx";    // Get AppKey and AppSID from https://dashboard.aspose.cloud/
string MyAppSid = "xxxxxxxx";    // Get AppKey and AppSID from https://dashboard.aspose.cloud/

SlidesApi api = new SlidesApi("MyAppSid", "MyAppKey");
PostSectionMoveRequest request = new PostSectionMoveRequest
{
    Name = "myPresentaion.pptx",
    Folder = "myFolder",
    SectionIndex = 1,
    NewPosition = 2
};
Sections sections = api.PostSectionMove(request);
Console.WriteLine(sections.SectionList.Count);

删除一个部分

请求 URL

DELETE https://api.aspose.cloud/v3.0/slides/myPresentation.pptx/sections/2?folder=myFolder

C#.NET

string MyAppKey = "xxxxxxxx";    // Get AppKey and AppSID from https://dashboard.aspose.cloud/
string MyAppSid = "xxxxxxxx";    // Get AppKey and AppSID from https://dashboard.aspose.cloud/

SlidesApi api = new SlidesApi("MyAppSid", "MyAppKey");
DeleteSectionRequest request = new DeleteSectionRequest
{
    Name = "myPresentaion.pptx",
    Folder = "myFolder",
    SectionIndex = 2
};
Sections sections = api.DeleteSection(request);
Console.WriteLine(sections.SectionList.Count);