CFXYZ.PowerPointEditorLib
1.0.8
See the version list below for details.
dotnet add package CFXYZ.PowerPointEditorLib --version 1.0.8
NuGet\Install-Package CFXYZ.PowerPointEditorLib -Version 1.0.8
<PackageReference Include="CFXYZ.PowerPointEditorLib" Version="1.0.8" />
paket add CFXYZ.PowerPointEditorLib --version 1.0.8
#r "nuget: CFXYZ.PowerPointEditorLib, 1.0.8"
// Install CFXYZ.PowerPointEditorLib as a Cake Addin #addin nuget:?package=CFXYZ.PowerPointEditorLib&version=1.0.8 // Install CFXYZ.PowerPointEditorLib as a Cake Tool #tool nuget:?package=CFXYZ.PowerPointEditorLib&version=1.0.8
PowerPoint Editor
A library to used to provide basic editing capabilities of PowerPoint presentation. It is primarily going to be used to give non-coders this ability via .net Interactive Notebooks. However, it could easily be used .net apps as well
Examples
Setup
var presentation = new PowerPointPresentation(pathToThePptx);
Text replacement
presentation.ForAllSlides()
.ReplaceText("{{TEAM_NAME}}")
.With("FooBar Unitied");
presentation.ForSlide(3)
.ReplaceText("{{TEAM_NAME}}")
.With("FooBar Unitied");
As you can see from the above, you can either specify to work with one single slide by its position in the deck with ForSlide(3)
or all slides with ForAllSlides()
.
Inside the powerpoint you are using as a template, we are looking for the text {{TEAM_NAME}} and will replace it with FooBar United.
Working with images
presentation.ForSlide(2)
.FindPictureWithAltText("TeamLogo")
.ReplaceImageWith("C:\MyTeamLogo.jpg");
presentation.ForSlide(2)
.FindPictureWithAltText("TeamLogo")
.ReplaceAltTextWith($"FooBar United Team Logo");
Here we are looking in slide 2 for an image with the alternate text to TeamLogo. We then replace the image with a jpg from our local disk and change the alternate text to be FooBar United Team Logo.
Working with bar charts
presentation.ForSlide(3)
.FindBarChart(1)
.FindSeriesByName("Category A")
.ReplaceValuesWith(new List<string> { "0.15", "0.3", "0.2", "0.2" });
presentation.ForSlide(3)
.FindBarChart(1)
.FindSeriesByName("Category B")
.ReplaceValuesWith(new List<string> { "0.2", "0.4", "0.3", "0.32" });
presentation.ForSlide(3)
.FindBarChart(1)
.FindSeriesByName("Category C")
.ReplaceValuesWith(new List<string> { "0.4", "0.8", "0.5", "0.48" });
We are editing the first bar chart on slide 3. It has 3 series and 4 values per series. We are adjusting the values of the chart to the percentages we have passed in.
Working with pie charts
presentation.ForSlide(4)
.FindPieChart(2)
.FindSeries()
.ReplaceValuesWith(new List<string> { "0.2", "0.25", "0.1", "0.45" });
We are editing the second pie chart on slide 4. It has 4 values and we are adjusting them to the values we have passed in.
Working with table contents
presentation.ForSlide(5)
.FindTable(1)
.FindRow(2)
.FindCell(1)
.ReplaceCellText("Default cell text", "New cell text");
We are editing the first table on slide 5. We are then editing the second row and first column to replace the text "Default cell text" with "New cell text".
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- DocumentFormat.OpenXml (>= 2.16.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.