ShapeCrawler (formerly SlideDotNet) is a .NET library for manipulating PowerPoint presentations. It provides a simplified object model on top of the Open XML SDK, allowing users to process presentations without having Microsoft Office installed.
Getting Started
install-package ShapeCrawler
Usage
Read presentation
// Open existing presentation
using var pres = SCPresentation.Open("some.pptx");
var shapeCollection = pres.Slides[0].Shapes;
// Get number of shapes on slide
var slidesCount = shapeCollection.Count;
// Get text
var autoShape = shapeCollection.GetByName<IAutoShape>("TextBox 1");
var text = autoShape.TextFrame!.Text;
Create presentation
// Create a new presentation
var pres = SCPresentation.Create();
var shapeCollection = pres.Slides[0].Shapes;
// Add new shape
var addedShape = shapeCollection.AddRectangle(x: 50, y: 60, w: 100, h: 70);
addedShape.TextFrame!.Text = "Hello World!";
pres.SaveAs("my_pres.pptx");
More samples
Visit the Wiki page to find more usage samples.
Have questions?
If you have a question:
- Join our Discussions Forum and open a discussion;
- You can always email the author at theadamo86@gmail.com
Contributing
How can you contribute?
- Give a Star⭐ If you find this useful, please give it a star to show your support.
- Bug report. If you encounter an issue, report the bug on the issue page.
- Code contributing. Pull Requests are welcome! Please read the Contribution Guide for more details.
Changelog
Version 0.45.3 - 2023-06-24
🐞Fixed updating Hyperlink #518
Visit CHANGELOG.md to see the full log.
Statistics Collection
Since February 15th, the library collects usage data to help us improve your experience. The data is collected by the maintainer and not shared with the community. Rest assured that we do not collect any sensitive or presentation content data. The collection includes, for example, information on the operating system, target framework, and frequently used shape types. If you prefer not to participate in this data collection, you can easily opt-out by setting the global setting SCSettings.CanCollectLogs = false
.