Skip to content

Instantly share code, notes, and snippets.

@aspose-cloud
Last active February 11, 2021 19:52
Show Gist options
  • Save aspose-cloud/003054ac27853f97767c300e79881d60 to your computer and use it in GitHub Desktop.
Save aspose-cloud/003054ac27853f97767c300e79881d60 to your computer and use it in GitHub Desktop.
This Gist repository contains code snippet related to Aspose.Slides Cloud API
Code snippets related to Aspose.Slides Cloud SDK for .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);
ChartCategory dto = new ChartCategory
{
Value = "NewCategory",
DataPoints = new List<OneValueChartDataPoint>
{
new OneValueChartDataPoint { Value = 5.5 },
new OneValueChartDataPoint { Value = 76 },
new OneValueChartDataPoint { Value = 27 }
}
};
PostChartCategoryRequest request = new PostChartCategoryRequest
{
Name = "myPresentaion.pptx",
Folder = "myFolder",
SlideIndex = 1,
ShapeIndex = 1,
Category = dto
};
Chart chart = api.PostChartCategory(request);
Console.WriteLine(chart.Categories.Count);
string MyAppKey = "xxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
string MyAppSid = "xxxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
// create an object of SlidesAPI while passing AppKey and AppSid information
SlidesApi slidesApi = new SlidesApi(MyAppSid, MyAppKey);
// upload file to cloud storage for processing
slidesApi.UploadFile(new UploadFileRequest(File.Open("Presentation1.pptx", FileMode.Open), "Presentation1.pptx", null));
// add new blank slide at first index. Index parameter is optional
slidesApi.PostSlidesAdd(new PostSlidesAddRequest("Presentation1.pptx"));
string MyAppKey = "xxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
string MyAppSid = "xxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
// initialize Aspose.Slides Cloud object
SlidesApi slidesApi = new SlidesApi(MyAppSid, MyAppKey);
String fileName = "NotesPresentation.pptx";
// NotesSlide dto object to represent the Slide notes
NotesSlide notesSlide = new NotesSlide();
// sample text for the Notes area
notesSlide.Text = "These are sample presenter notes added using Aspose.Slides Cloud";
// Create PostAddNotesSlideRequest object to add Notes to PPTX file
PostAddNotesSlideRequest postAddNotesSlideRequest = new PostAddNotesSlideRequest();
// name of the file to which Notes are required to be added
postAddNotesSlideRequest.Name = fileName;
// index of slide within PowerPoint presentation
postAddNotesSlideRequest.SlideIndex = 1;
// NotesSlide object
postAddNotesSlideRequest.Dto = notesSlide;
// add NotesSlideRequest to SlidesApi instance
slidesApi.PostAddNotesSlide(postAddNotesSlideRequest);
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);
ScatterChartDataPoint dto = new ScatterChartDataPoint
{
 XValue = 5.5,
 YValue = 8
};
PostChartDataPointRequest request = new PostChartDataPointRequest
{
 Name = "myPresentaion.pptx",
 Folder = "myFolder",
 SlideIndex = 1,
 ShapeIndex = 1,
 SeriesIndex = 2,
 DataPoint = dto
};
Chart chart = api.PostChartDataPoint(request);
Console.WriteLine(((ScatterSeries)chart.Series[1]).DataPoints.Count);
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");
OneValueSeries dto = new OneValueSeries();
dto.DataPoints = new List<OneValueChartDataPoint>();
dto.DataPoints.Add(new OneValueChartDataPoint { Value = 5.5 });
dto.DataPoints.Add(new OneValueChartDataPoint { Value = 76 });
dto.DataPoints.Add(new OneValueChartDataPoint { Value = 27 });
PostChartSeriesRequest request = new PostChartSeriesRequest
{
Name = "myPresentaion.pptx",
Folder = "myFolder",
SlideIndex = 1,
ShapeIndex = 1,
Series = dto
};
Chart chart = api.PostChartSeries(request);
Console.WriteLine(chart.Series.Count);
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
// For complete examples and data files, please go to https://github.com/aspose-slides-cloud/aspose-slides-cloud-dotnet
string MyAppKey = "xxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
string MyAppSid = "xxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
// initialize Aspose.Slides Cloud instance
SlidesApi api = new SlidesApi(MyAppSid, MyAppKey);
// Create an object of PostSlidesSaveAsRequest to transform the file
PostSlidesSaveAsRequest request = new PostSlidesSaveAsRequest
{
Name = "NotesPresentation.pptx",
Format = ExportFormat.Fodp,
};
Stream response = api.PostSlidesSaveAs(request);
// save the resultant file to system drive
response.CopyTo(File.Create("myPresentation.fodp"));
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);
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);
try
{
FileStream file = File.Open("Resources\\test-unprotected.ppt", FileMode.Open);
var request = new PostSlidesConvertRequest(ExportFormat.Pdf, file, null, "customfonts/Pacifico.ttf");
var response = slidesApi.PostSlidesConvert(request);
Console.WriteLine("Response: " + response.ToString());
}
catch (Exception e)
{
Console.WriteLine("Exception while calling Api: " + e.ToString());
}
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);
PostSlidesSaveAsRequest request = new PostSlidesSaveAsRequest
{
 Name = "myPresentaion.pptx",
 Folder = "myFolder",
 Format = ExportFormat.Pdf,
 Options = new PdfExportOptions { DefaultRegularFont = "Calibri" }
};
Stream response = api.PostSlidesSaveAs(request);
response.CopyTo(File.Create("myPresentation.pdf"));
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);
DeleteChartCategoryRequest request = new DeleteChartCategoryRequest
{
    Name = "myPresentaion.pptx",
    Folder = "myFolder",
    SlideIndex = 1,
    ShapeIndex = 1,
    CategoryIndex = 2
};
Chart chart = api.DeleteChartCategory(request);
Console.WriteLine(chart.Categories.Count);
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);
DeleteChartDataPointRequest request = new DeleteChartDataPointRequest
{
 Name = "myPresentaion.pptx",
 Folder = "myFolder",
 SlideIndex = 1,
 ShapeIndex = 1,
 SeriesIndex = 2,
 PointIndex = 2
};
Chart chart = api.DeleteChartDataPoint(request);
Console.WriteLine(((ScatterSeries)chart.Series[1]).DataPoints.Count);
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");
DeleteChartSeriesRequest request = new DeleteChartSeriesRequest
{
Name = "myPresentaion.pptx",
Folder = "myFolder",
SlideIndex = 1,
ShapeIndex = 1,
SeriesIndex = 2
};
Chart chart = api.DeleteChartSeries(request);
Console.WriteLine(chart.Series.Count);
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);
string MyAppKey = "xxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
string MyAppSid = "xxxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
// create an object of SlidesAPI while passing AppKey and AppSid information
SlidesApi slidesApi = new SlidesApi(MyAppSid, MyAppKey);
// upload file to cloud storage for processing
slidesApi.UploadFile(new UploadFileRequest(File.Open("Presentation1.pptx", FileMode.Open), "Presentation1.pptx", null));
// delete slide on second index
slidesApi.DeleteSlideByIndex(new DeleteSlideByIndexRequest("Presentation1.pptx", 2));
// complete examples can be found over https://github.com/aspose-slides-cloud/aspose-slides-cloud-dotnet
string MyAppKey = "xxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
string MyAppSid = "xxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
// initialize Aspose.Slides Cloud instance
SlidesApi Slidesapi = new SlidesApi(MyAppSid, MyAppKey);
// Load PowerPoint from Cloud storage and determine notes in first slide
GetNotesSlideExistsRequest request = new GetNotesSlideExistsRequest
{
Name = "Presentation1-a.pptx",
SlideIndex = 1
};
// identify if notes exist in slide
EntityExists exists = Slidesapi.GetNotesSlideExists(request);
// print result on console
Console.WriteLine(exists.Exists);
// Complete examples can be found over https://github.com/aspose-slides-cloud/aspose-slides-cloud-dotnet
string MyAppKey = "xxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
string MyAppSid = "xxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
// initialize Aspose.Slides Cloud instance
SlidesApi Slidesapi = new SlidesApi(MyAppSid, MyAppKey);
// Load PowerPoint from local system drive and determine notes in first slide
PostGetNotesSlideExistsRequest request = new PostGetNotesSlideExistsRequest
{
Document = File.OpenRead("Presentation1-a.pptx"),
SlideIndex = 1
};
// identify if notes exist in slide
EntityExists exists = Slidesapi.PostGetNotesSlideExists(request);
// print result on console
Console.WriteLine("Notes exist in Slide :"+ exists.Exists);
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);
// please viist following link for complete source code https://github.com/aspose-slides-cloud/aspose-slides-cloud-dotnet
try
{
String Client_ID = "xxxxxxx-1c8e-4ea4-a948-3857547232fa";
String Client_Secret = "xxxxxxxx237f013e329cdf5694cc96a";
// instantiate SlidesAPI object
SlidesApi slidesApi = new SlidesApi(Client_ID, Client_Secret);
// Create PutSlidesSlidePropertiesRequest object and provide input PPTX as argument
GetSlidesProtectionPropertiesRequest request = new GetSlidesProtectionPropertiesRequest
{
// speicfy input PowerPoint presentation
Name = "input.pptx",
};
ProtectionProperties slideProperties = slidesApi.GetSlidesProtectionProperties(request);
// read the width property of slide
Console.WriteLine("Encrypted Document Properties = "+slideProperties.EncryptDocumentProperties);
Console.WriteLine("Read Only Recommended = "+slideProperties.ReadOnlyRecommended);
Console.WriteLine("Self URi = " + slideProperties.SelfUri);
}
catch (Exception e)
{
Console.WriteLine("Exception while calling Api: " + e.ToString());
}
// complete examples can be found over https://github.com/aspose-slides-cloud/aspose-slides-cloud-dotnet
string MyAppKey = "xxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
string MyAppSid = "xxxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
try
{
// instantiate SlidesAPI object
Aspose.Slides.Cloud.Sdk.SlidesApi slidesApi = new Aspose.Slides.Cloud.Sdk.SlidesApi(Client_ID, Client_Secret);
// Create GetSlidesSlidePropertiesRequest object and provide input PPTX reference
GetSlidesSlidePropertiesRequest request = new GetSlidesSlidePropertiesRequest { Name = "input.pptx" };
// Read Slide properties
SlideProperties slideProperties = slidesApi.GetSlidesSlideProperties(request);
// display First slide number details
Console.WriteLine(slideProperties.FirstSlideNumber);
// print orientation details of slide
Console.WriteLine(slideProperties.Orientation);
// print the height details for slide
Console.WriteLine(slideProperties.Height);
// print width details for slide
Console.WriteLine(slideProperties.Width);
// print information related to scaleType
Console.WriteLine(slideProperties.ScaleType);
}
catch (Exception e)
{
Console.WriteLine("Exception while calling Api: " + e.ToString());
}
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");
PostAddNewShapeRequest request = new PostAddNewShapeRequest
{
Name = "myPresentaion.pptx",
Folder = "myFolder",
SlideIndex = 2,
Dto = new Chart
{
ChartType = Chart.ChartTypeEnum.Sunburst,
Width = 400,
Height = 300,
Categories = new List<ChartCategory>
{
new ChartCategory { Value = "Leaf1", Level = 3, ParentCategories = new List<string> { "Branch1", "Stem1" } },
new ChartCategory { Value = "Leaf2", Level = 3, ParentCategories = new List<string> { "Branch1", "Stem1" } },
new ChartCategory { Value = "Branch2", Level = 2, ParentCategories = new List<string> { "Stem1" } },
new ChartCategory { Value = "Stem2", Level = 1 }
},
Series = new List<Series>
{
new OneValueSeries
{
Name = "Series1",
DataPoints = new List<OneValueChartDataPoint>
{
new OneValueChartDataPoint { Value = 40 },
new OneValueChartDataPoint { Value = 50 },
new OneValueChartDataPoint { Value = 70 },
new OneValueChartDataPoint { Value = 80 }
}
}
}
}
};
Chart chart = TestUtils.SlidesApi.PostAddNewShape(request) as Chart;
Console.WriteLine(chart.Categories.Count); //4
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);
string MyAppKey = "xxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
string MyAppSid = "xxxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
// create an object of SlidesAPI while passing AppKey and AppSid information
SlidesApi slidesApi = new SlidesApi(MyAppSid, MyAppKey);
// upload file to cloud storage for processing
slidesApi.UploadFile(new UploadFileRequest(File.Open("Presentation1.pptx", FileMode.Open), "Presentation1.pptx", null));
// move slide from index 2 to index 1
slidesApi.PostSlidesReorder(new PostSlidesReorderRequest("Presentation1.pptx", 2, 1));
// please viist following link for complete source code https://github.com/aspose-slides-cloud/aspose-slides-cloud-dotnet
using System;
using System.IO;
using Aspose.Slides.Cloud.Sdk.Model;
using Aspose.Slides.Cloud.Sdk.Model.Requests;
string Client_ID = "xxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
string Client_Secret = "xxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
try
{
// instantiate SlidesAPI object
SlidesApi slidesApi = new SlidesApi(Client_ID, Client_Secret);
// load input PDF file from local storage
Stream file = File.OpenRead("Converted.pdf");
// create an object of PostSlidesDocumentFromPdfRequest object containing resultant file name
PostSlidesDocumentFromPdfRequest request = new PostSlidesDocumentFromPdfRequest { Name = "Resultant.pptx", Pdf = file };
// perform the PDF to PPTX conversion operation
Document response = slidesApi.PostSlidesDocumentFromPdf(request);
}
catch (Exception e)
{
Console.WriteLine("Exception while calling Api: " + e.ToString());
}
// please viist following link for complete source code https://github.com/aspose-slides-cloud/aspose-slides-cloud-dotnet
using System;
using System.IO;
using Aspose.Slides.Cloud.Sdk.Model;
using Aspose.Slides.Cloud.Sdk.Model.Requests;
string Client_ID = "xxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
string Client_Secret = "xxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
try
{
// instantiate SlidesAPI object
Aspose.Slides.Cloud.Sdk.SlidesApi slidesApi = new Aspose.Slides.Cloud.Sdk.SlidesApi(Client_ID, Client_Secret);
// load input PDF file from local storage
Stream presentation = File.OpenRead("input.pptx");
// specify the output format for resultant file
PostSlidesConvertRequest convertRequest = new PostSlidesConvertRequest(presentation, Aspose.Slides.Cloud.Sdk.Model.ExportFormat.Pdf);
// initialize the conversion process
Stream pdf = slidesApi.PostSlidesConvert(convertRequest);
// save resultant file to local storage
pdf.CopyTo(File.OpenWrite("MyPresentation.pdf"));
}
catch (Exception e)
{
Console.WriteLine("Exception while calling Api: " + e.ToString());
}
// complete examples can be found over https://github.com/aspose-slides-cloud/aspose-slides-cloud-dotnet
string MyAppKey = "xxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
string MyAppSid = "xxxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
// initialize Aspose.Slides Cloud instance
SlidesApi Slidesapi = new SlidesApi(MyAppSid, MyAppKey);
// PdfExportOption instance to set options during PDF rendering
Aspose.Slides.Cloud.Sdk.Model.PdfExportOptions pdfExportOptions = new PdfExportOptions();
// select PDF/A compliance format
pdfExportOptions.Compliance = PdfExportOptions.ComplianceEnum.PdfA1a;
// load PPTX from cloud storage and set export format as PDF and PdfExportOptions
PostSlideSaveAsRequest postSlideSaveAsRequest = new PostSlideSaveAsRequest("Presentation1-a.pptx", 1, SlideExportFormat.Pdf, pdfExportOptions);
// parse resultant file to stream object
Stream pdf = Slidesapi.PostSlideSaveAs(postSlideSaveAsRequest);
// save the resultant file to system drive
pdf.CopyTo(File.OpenWrite("MyPresentation-pdf-a1a.pdf"));
// complete examples can be found over https://github.com/aspose-slides-cloud/aspose-slides-cloud-dotnet
string MyAppKey = "xxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
string MyAppSid = "xxxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
// initialize Aspose.Slides Cloud instance
SlidesApi Slidesapi = new SlidesApi(MyAppSid, MyAppKey);
// create an object to load PPTX and access 4th shape object on 2nd slide
PostSubshapeSaveAsRequest request = new PostSubshapeSaveAsRequest
{
Name = "Presentation1-a.pptx",
SlideIndex = 2,
ShapeIndex = 4,
Format = ShapeExportFormat.Png,
ScaleX = 2,
ScaleY = 2
};
// get the shape object into Stream instance
Stream file = Slidesapi.PostSubshapeSaveAs(request);
// save the raster image over system drive
file.CopyTo(File.Create("subshape.png"));
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
// please viist following link for complete source code https://github.com/aspose-slides-cloud/aspose-slides-cloud-dotnet
try
{
String Client_ID = "xxxxxxxx-1c8e-4ea4-a948-3857547232fa";
String Client_Secret = "xxxxxxxx237f013e329cdf5694cc96a";
// instantiate SlidesAPI object
Aspose.Slides.Cloud.Sdk.SlidesApi slidesApi = new Aspose.Slides.Cloud.Sdk.SlidesApi(Client_ID, Client_Secret);
// Create PutSlidesSlidePropertiesRequest object and provide input PPTX as argument
PutSlidesSlidePropertiesRequest request = new PutSlidesSlidePropertiesRequest {
// speicfy input PowerPoint presentation
Name = "input.pptx",
Dto = new SlideProperties {
Width = 900,
Height = 600,
Orientation = SlideProperties.OrientationEnum.Portrait,
ScaleType = SlideProperties.ScaleTypeEnum.DoNotScale,
SizeType = SlideProperties.SizeTypeEnum.OnScreen,
}
};
SlideProperties response = slidesApi.PutSlidesSlideProperties(request);
// read the width property of slide
Console.WriteLine(response.Width);
// read the height property of slide
Console.WriteLine(response.Height);
}
catch (Exception e)
{
Console.WriteLine("Exception while calling Api: " + e.ToString());
}
string MyAppKey = "xxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
string MyAppSid = "xxxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
// create an object of SlidesAPI while passing AppKey and AppSid information
SlidesApi slidesApi = new SlidesApi(MyAppSid, MyAppKey);
String fileName = "Presentation1.pptx";
int? width = null;
int? height = null;
int? from = 1;
int? to = 2;
// upload PowerPoint.pptx to Cloud storage
slidesApi.UploadFile(new UploadFileRequest(File.Open("Presentation1.pptx", FileMode.Open), "Presentation1.pptx", null));
// Split PowerPoint slides from index 1 to 2 and save output in PPTX format
slidesApi.PostSlidesSplit(new PostSlidesSplitRequest(fileName, null, SlideExportFormat.Pptx, width, height, to, from));
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);
ChartCategory dto = new ChartCategory
{
    Value = "UpdatedCategory",
    DataPoints = new List<OneValueChartDataPoint>
    {
        new OneValueChartDataPoint { Value = 5.5 },
        new OneValueChartDataPoint { Value = 76 },
        new OneValueChartDataPoint { Value = 27 }
    }
};
PutChartCategoryRequest request = new PutChartCategoryRequest
{
    Name = "myPresentaion.pptx",
    Folder = "myFolder",
    SlideIndex = 1,
    ShapeIndex = 1,
    CategoryIndex = 2,
    Category = dto
};
Chart chart = api.PutChartCategory(request);
Console.WriteLine(chart.Categories.Count);
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);
ScatterChartDataPoint dto = new ScatterChartDataPoint
{
 XValue = 5.5,
 YValue = 8
};
PutChartDataPointRequest request = new PutChartDataPointRequest
{
 Name = "myPresentaion.pptx",
 Folder = "myFolder",
 SlideIndex = 1,
 ShapeIndex = 1,
 SeriesIndex = 2,
 PointIndex = 2,
 DataPoint = dto
};
Chart chart = api.PutChartDataPoint(request);
Console.WriteLine(((ScatterSeries)chart.Series[1]).DataPoints[1].XValue); //5.5
string MyAppKey = "xxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
string MyAppSid = "xxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
// initialize Aspose.Slides Cloud object
SlidesApi slidesApi = new SlidesApi(MyAppSid, MyAppKey);
String fileName = "NotesPresentation.pptx";
// NotesSlide dto object to represent the Slide notes
NotesSlide notesSlide = new NotesSlide();
// sample text for the Notes area
notesSlide.Text = "Notes updated using Aspose.Slides Cloud API";
// Create PutUpdateNotesSlideRequest object to update Notes inside PPTX file
PutUpdateNotesSlideRequest putUpdateNotesSlideRequest = new PutUpdateNotesSlideRequest();
// name of the file to which Notes are required to be updated
putUpdateNotesSlideRequest.Name = fileName;
// index of slide within PowerPoint presentation
putUpdateNotesSlideRequest.SlideIndex = 1;
// NotesSlide object
putUpdateNotesSlideRequest.Dto = notesSlide;
// add PutUpdateNotesSlideRequest to SlidesApi instance
slidesApi.PutUpdateNotesSlide(putUpdateNotesSlideRequest);
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");
OneValueSeries dto = new OneValueSeries();
dto.DataPoints = new List<OneValueChartDataPoint>();
dto.DataPoints.Add(new OneValueChartDataPoint { Value = 5.5 });
dto.DataPoints.Add(new OneValueChartDataPoint { Value = 76 });
dto.DataPoints.Add(new OneValueChartDataPoint { Value = 27 });
PutChartSeriesRequest request = new PutChartSeriesRequest
{
Name = "myPresentaion.pptx",
Folder = "myFolder",
SlideIndex = 1,
ShapeIndex = 1,
SeriesIndex = 2,
Series = dto
};
Chart chart = api.PutChartSeries(request);
Console.WriteLine(((OneValueSeries)chart.Series[1]).DataPoints.Count);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment