PPTX File Viewer for .NET
View presentation files such as PPTX without Microsoft PowerPoint or Office Automation
View PPTX File Using C#
In order to view PPTX file, we’ll use
API which is a feature-rich, powerful and easy to use API for C# platform to be used with any Viewer. Open
package manager, search for Aspose.Slides and install. You may also use the following command from the Package Manager Console.
Package Manager Console Command
PM> Install-Package Aspose.Slides.NET
How to View PPTX via C#
Aspose.Slides makes it easy for the developers to view the PPTX file with just few lines of code.
Instantiate a Presentation object & load the PPTX file
Create an instance of ResponsiveHtmlController for formatting
Create an instance of HtmlOptions and set HtmlFormatter property
Save the PPTX presentation in HTML format
Call Process.Start with path to resultant HTML to load PPTX content in default browser
System Requirements
Aspose.Slides for .NET is supported on all major operating systems. Just make sure that you have the following prerequisites.
- Microsoft Windows or a compatible OS with .NET Framework, .NET Core, Windows Azure, Mono or Xamarin Platforms
- Development environment like Microsoft Visual Studio
- Aspose.Slides for .NET referenced in your project
C# example code to view PPTX file
string output = System.IO.Path.GetTempPath() + Guid.NewGuid().ToString() + ".html";
// instantiate a Presentation object & load the PPTX file
using (var presentation = new Aspose.Slides.Presentation("templatepptx"))
{
// create HTML export controller
var controller = new Aspose.Slides.Export.ResponsiveHtmlController();
// create an instance of HtmlOptions and set HtmlFormatter property
var htmlOptions = new Aspose.Slides.Export.HtmlOptions
{
HtmlFormatter = Aspose.Slides.Export.HtmlFormatter.CreateCustomFormatter(controller)
};
// save the presentation in HTML
presentation.Save(output, Aspose.Slides.Export.SaveFormat.Html, htmlOptions);
}
// load HTML to view the presentation content
System.Diagnostics.Process.Start(output);
About Aspose.Slides for .NET API
Aspose.Slides API can be used to read, write, manipulate and convert Microsoft PowerPoint documents to PDF, XPS, HTML, TIFF, ODP and various other formats. One can create new files from scratch and save those in the relevant supported formats. Aspose.Slides is a standalone API for creating, parsing or manipulating presentations, slides and elements and it does not depend on any software like Microsoft or OpenOffice.Free App to View PPTX
Other Supported Viewer Formats
Using C#, One can also view many other file formats including.