EXCEL 工具 在 C# 中如何查看 PowerPoint 文件 Curtis Chau 已更新:九月 10, 2025 Download IronXL NuGet 下载 DLL 下载 Start Free Trial Copy for LLMs Copy for LLMs Copy page as Markdown for LLMs Open in ChatGPT Ask ChatGPT about this page Open in Gemini Ask Gemini about this page Open in Grok Ask Grok about this page Open in Perplexity Ask Perplexity about this page Share Share on Facebook Share on X (Twitter) Share on LinkedIn Copy URL Email article Working with PowerPoint in C# Using IronPPT While building a PowerPoint viewer in C# is not yet supported, developers still have powerful tools at their disposal for programmatically working with presentation files. IronPPT is a modern .NET library built to help developers create, read, and edit PowerPoint files (.pptx) using C#—without requiring Microsoft Office or COM Interop. Introducing IronPPT: The .NET PowerPoint Library from Iron Software IronPPT seamlessly loads and saves PPTX files - no Microsoft Office required. Perfect for automating slides, text, shapes, and images in any .NET application. Get started with IronPPT now! If your goal is to dynamically generate slide decks, manipulate existing content, or integrate PowerPoint automation into your .NET workflows, IronPPT is designed to streamline those processes with a clean and intuitive API. Let’s take a closer look at what you can do with IronPPT: Key Features of IronPPT IronPPT focuses on empowering developers to work with PowerPoint presentations from code. Here are the core features currently supported: Create PowerPoint Presentations from Scratch IronPPT lets you programmatically generate .pptx files, define slide layouts, add textboxes, insert images and shapes, and customize formatting. You can build polished slide decks dynamically based on data or user input—ideal for reporting, templating, and content automation. Edit Existing .pptx Files You can open and modify PowerPoint files to update text, replace or insert images, reorder slides, change formatting, or append new content. This makes it well-suited for batch processing or integrating automated updates into your business workflows. Access and Manipulate Slide Elements IronPPT gives you full control over slide components. You can: Add or remove textboxes and paragraphs Modify font styles, alignment, and spacing Insert and style shapes with configurable properties Load images from file or stream and position them precisely Read Slide Content In addition to writing slides, IronPPT can also read and extract content from existing .pptx files. This includes slide titles, paragraph text, images, and shapes—allowing you to repurpose or analyze presentation data. No Microsoft Office Required IronPPT works completely independently of Microsoft PowerPoint. There’s no need for Office installations or Interop libraries, which makes it ideal for deployment in server environments, CI/CD pipelines, cloud apps, and cross-platform projects. When to Use IronPPT IronPPT is best suited for .NET developers who need to: Automate the creation of presentation files Modify .pptx content programmatically Extract and analyze slide content Work in environments where Office is not available While it doesn’t support exporting or viewing presentations yet, IronPPT remains a robust and forward-looking solution for backend PowerPoint generation and processing in C#. IronPPT vs Office Interop (Comparison Table) IronPPT in Action Now that we’ve learned more about IronPPT and how it works, let’s look at how it works by using it to create a new presentation document with a title, custom shape, and image. While this example is just a basic look at how these features work, you can easily implement them to create visually unique and informational PowerPoint presentations. Code Example using IronPPT; using IronPPT.Models; var doc = new PresentationDocument(); // Add a title to the first slide doc.Slides[0].TextBoxes[0].AddText("Welcome to IronPPT!"); // Adding an image to the first slide Image image = new Image(); image.LoadFromFile("ironppt.png"); var newImage = doc.AddImage(image, 0); newImage.Position = (100, 300); newImage.Width = 500; newImage.Height = 200; // Adding a new slide with a custom shape Slide slide = new Slide(); doc.AddSlide(slide); Shape shape = new Shape(); shape.Type = IronPPT.Enums.ShapeType.Cloud; shape.Width = 200; shape.Position = (200, 200); shape.FillColor = new Color(255, 0, 0); // Red color shape.OutlineColor = Color.Black; // Black outline doc.Slides[1].AddShape(shape); doc.Save("test.pptx"); using IronPPT; using IronPPT.Models; var doc = new PresentationDocument(); // Add a title to the first slide doc.Slides[0].TextBoxes[0].AddText("Welcome to IronPPT!"); // Adding an image to the first slide Image image = new Image(); image.LoadFromFile("ironppt.png"); var newImage = doc.AddImage(image, 0); newImage.Position = (100, 300); newImage.Width = 500; newImage.Height = 200; // Adding a new slide with a custom shape Slide slide = new Slide(); doc.AddSlide(slide); Shape shape = new Shape(); shape.Type = IronPPT.Enums.ShapeType.Cloud; shape.Width = 200; shape.Position = (200, 200); shape.FillColor = new Color(255, 0, 0); // Red color shape.OutlineColor = Color.Black; // Black outline doc.Slides[1].AddShape(shape); doc.Save("test.pptx"); Imports IronPPT Imports IronPPT.Models Private doc = New PresentationDocument() ' Add a title to the first slide doc.Slides(0).TextBoxes(0).AddText("Welcome to IronPPT!") ' Adding an image to the first slide Dim image As New Image() image.LoadFromFile("ironppt.png") Dim newImage = doc.AddImage(image, 0) newImage.Position = (100, 300) newImage.Width = 500 newImage.Height = 200 ' Adding a new slide with a custom shape Dim slide As New Slide() doc.AddSlide(slide) Dim shape As New Shape() shape.Type = IronPPT.Enums.ShapeType.Cloud shape.Width = 200 shape.Position = (200, 200) shape.FillColor = New Color(255, 0, 0) ' Red color shape.OutlineColor = Color.Black ' Black outline doc.Slides(1).AddShape(shape) doc.Save("test.pptx") $vbLabelText $csharpLabel Output IronPPT Licensing IronPPT offers commercial licensing with individual tiers to best fit your needs. From perpetual licensing that provides coverage for your projects based on the number of developers, projects, and locations you need covered, to monthly subscription-based licensing that provides a more pay-as-you-go model for teams who don’t want to commit to a yearly subscription. You can evaluate IronPPT risk-free using the free trial, which includes all features with a watermark applied during output. This allows full testing and integration into your existing .NET workflows before committing to a production license. Conclusion: Build Smarter PowerPoint Workflows in .NET Although IronPPT doesn’t yet support rendering slides or viewing presentations in real time, it delivers powerful tools for automating PowerPoint file creation, editing, and content extraction within your C# applications. For backend processing, dynamic slide generation, and Office-free .pptx handling, IronPPT is a developer-friendly, scalable solution that integrates seamlessly into modern .NET projects. If you're ready to streamline your PowerPoint workflows and eliminate Office dependencies, start your free trial of IronPPT today: 👉 Download IronPPT Free Trial Explore its capabilities, test it in your real-world environment, and see how easy it is to bring PowerPoint automation to your .NET applications. Curtis Chau 立即与工程团队聊天 技术作家 Curtis Chau 拥有卡尔顿大学的计算机科学学士学位,专注于前端开发,精通 Node.js、TypeScript、JavaScript 和 React。他热衷于打造直观且美观的用户界面,喜欢使用现代框架并创建结构良好、视觉吸引力强的手册。除了开发之外,Curtis 对物联网 (IoT) 有浓厚的兴趣,探索将硬件和软件集成的新方法。在空闲时间,他喜欢玩游戏和构建 Discord 机器人,将他对技术的热爱与创造力相结合。 相关文章 已更新六月 22, 2025 如何在 C# 中创建 PowerPoint 模板 在本篇文章中,我们将探讨如何使用 C# 从模板创建 PowerPoint 阅读更多 已更新六月 22, 2025 使用 .NET Regex Tester 测试您的正则表达式模式 本文深入探讨 .NET Regex Tester 的功能,提供对其用法和与 IronXL 集成的见解和示例 阅读更多 已更新六月 22, 2025 如何在 Java 中读取 Excel 文件(教程) 读取Excel文件有时可能会很复杂。在Java中读取Excel文件与在Java中读取Word文件有些不同,因为Excel的单元格。 阅读更多 如何在 C# 中创建 PowerPoint 模板
已更新六月 22, 2025 使用 .NET Regex Tester 测试您的正则表达式模式 本文深入探讨 .NET Regex Tester 的功能,提供对其用法和与 IronXL 集成的见解和示例 阅读更多
已更新六月 22, 2025 如何在 Java 中读取 Excel 文件(教程) 读取Excel文件有时可能会很复杂。在Java中读取Excel文件与在Java中读取Word文件有些不同,因为Excel的单元格。 阅读更多