https://github.com/shapecrawler/shapecrawler
π A .NET library for manipulating PowerPoint presentations
https://github.com/shapecrawler/shapecrawler
csharp dotnet hacktoberfest ooxml openxml powerpoint powerpoint-presentations pptx presentation shapecrawler slide
Last synced: about 3 hours ago
JSON representation
π A .NET library for manipulating PowerPoint presentations
- Host: GitHub
- URL: https://github.com/shapecrawler/shapecrawler
- Owner: ShapeCrawler
- License: mit
- Created: 2019-07-13T14:04:02.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-04-11T16:54:46.000Z (11 months ago)
- Last Synced: 2025-04-11T17:13:42.541Z (11 months ago)
- Topics: csharp, dotnet, hacktoberfest, ooxml, openxml, powerpoint, powerpoint-presentations, pptx, presentation, shapecrawler, slide
- Language: C#
- Homepage:
- Size: 66.4 MB
- Stars: 344
- Watchers: 8
- Forks: 69
- Open Issues: 63
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README

[](https://makeapullrequest.com)

[](https://github.com/ShapeCrawler/ShapeCrawler/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)
PowerPoint (PPTX) manipulation library for .NET / C# developers
ShapeCrawler provides a clean, intuitive API on top of the Open XML SDK, making it easy to read, create, and modify `.pptx` files programmatically.
---
## π¦ Installation
```bash
dotnet add package ShapeCrawler
```
## π Getting Started
```csharp
// Load an existing presentation
var pres = new Presentation("presentation.pptx");
// Access shapes on a slide
var shapes = pres.Slide(1).Shapes;
var textBox = shapes.Shape("TextBox 1");
// Read text content
var text = textBox.TextBox.Text;
// Modify and save
textBox.TextBox.SetText("Updated content");
pres.Save();
```
## π― Why ShapeCrawler?
- **No Office Required** β Process presentations on any platform without Microsoft Office installation
- **Clean API** β Intuitive object model that hides the complexity of Open XML
- **Open Source** β Actively maintained
## π‘ Common Use Cases
### Create presentations
```csharp
// Create a new presentation with a slide
var pres = new Presentation(p => p.Slide());
// Add a shape with text
var shapes = pres.Slide(1).Shapes;
shapes.AddShape(x: 50, y: 60, width: 100, height: 70);
var addedShape = shapes.Last();
addedShape.TextBox.SetText("Hello World!");
pres.Save("output.pptx");
```
### Update image
```csharp
var pres = new Presentation("presentation.pptx");
var picture = pres.Slide(1).Shape("Picture 1").Picture;
// Replace the image
using var newImage = File.OpenRead("new-image.png");
picture.Image.Update(newImage);
pres.Save();
```
### Tables
#### Create table
```csharp
var pres = new Presentation("presentation.pptx");
var shapes = pres.Slide(1).Shapes;
// Add a 3x2 table at position (50, 120)
shapes.AddTable(x: 50, y: 120, columnsCount: 3, rowsCount: 2);
var table = shapes.Last().Table;
table[0, 0].TextBox.SetText("Hello table");
pres.Save();
```
#### Update table
```csharp
var pres = new Presentation("presentation.pptx");
var table = pres.Slide(1).Shapes.Shape("Table 1").Table;
// Insert a row at index 1, using row 0 as a template
table.Rows.Add(1, 0);
// Merge two header cells
table.MergeCells(table[0, 0], table[0, 1]);
pres.Save();
```
### Lines
#### Adding a straight line
```csharp
var pres = new Presentation("presentation.pptx");
var shapes = pres.Slide(1).Shapes;
// Add a line from (50, 60) to (100, 60)
shapes.AddLine(startPointX: 50, startPointY: 60, endPointX: 100, endPointY: 60);
```
#### Accessing Start and End Points
```csharp
var pres = new Presentation("presentation.pptx");
var line = pres.Slide(1).Shapes.First(shape => shape.GeometryType == Geometry.Line).Line;
var start = line.StartPoint; // Point(x, y)
var end = line.EndPoint; // Point(x, y)
Console.WriteLine($"Line from {start.X},{start.Y} to {end.X},{end.Y}");
```
### Charts
#### Create Bar Chart
```csharp
var pres = new Presentation(p => p.Slide());
var shapes = pres.Slide(1).Shapes;
var points = new Dictionary
{
{ "Q1", 50 },
{ "Q2", 60 },
{ "Q3", 40 }
};
// Add a bar chart
shapes.AddBarChart(x: 100, y: 100, width: 500, height: 350, points, "Sales");
pres.Save("output.pptx");
```
#### Update Chart Category
```csharp
var pres = new Presentation("presentation.pptx");
var chart = pres.Slide(1).Shapes.Shape("Bar Chart 1").BarChart;
// Update category name
chart.Categories[0].Name = "Renamed Category";
pres.Save();
```
### More Examples
**[See More Examples](https://github.com/ShapeCrawler/ShapeCrawler/tree/master/examples)**
## β Getting Help
Have questions? We're here to help!
- [Issues](https://github.com/ShapeCrawler/ShapeCrawler/issues) β Report bugs or request features
- [Discussions Forum](https://github.com/ShapeCrawler/ShapeCrawler/discussions) β Ask questions and share ideas
- Email β Reach out to theadamo86@gmail.com
## π€ Contributing
We love contributions! Here's how you can help:
- Give us a star β β If you find ShapeCrawler useful, show your support with a star!
- Reporting Bugs β Found a bug? [Open an issue](https://github.com/ShapeCrawler/ShapeCrawler/issues) with a clear description of the problem
- Contribute Code β Pull requests are welcome!
- Need to share a confidential file? β Email it to theadamo86@gmail.com β only the maintainer will access it
## π Pre-release Versions
Want to try the latest features? Access pre-release builds from the `master` branch using the following NuGet: `https://www.myget.org/F/shape/api/v3/index.json`
## π Changelog
### Version 0.78.3 - 2026-02-27
πResolved potential security vulnerabilities
[**View Full Changelog**](https://github.com/ShapeCrawler/ShapeCrawler/blob/master/CHANGELOG.md)