HTML JPG PDF XML PPTX
Aspose.Slides  for .NET
PPTX

.NET 的 PPTX 文件查看器

在沒有 Microsoft PowerPoint 或 Office 自動化的情況下查看演示文件,例如 PPTX

如何使用 C# 查看 PPTX 文件

為了查看 PPTX 文件,我們將使用

Aspose.Slides for .NET

API 是一個功能豐富、功能強大且易於使用的 C# 平台 API,可與任何查看器一起使用。打開

NuGet

包管理器,搜索 Aspose.Slides 並安裝。您還可以從包管理器控制台使用以下命令。

包管理器控制台命令


PM> Install-Package Aspose.Slides.NET

通過 C# 查看 PPTX 的步驟

Aspose.Slides 使開發人員只需幾行代碼即可輕鬆查看 PPTX 文件。

  1. 實例化一個 Presentation 對象並加載 PPTX 文件

  2. 創建一個用於格式化的 ResponsiveHtmlController 實例

  3. 創建 HtmlOptions 的實例並設置 HtmlFormatter 屬性

  4. 以 HTML 格式保存 PPTX 演示文稿

  5. 調用 Process.Start 以生成 HTML 的路徑以在默認瀏覽器中加載 PPTX 內容

系統要求

所有主要操作系統都支持 Aspose.Slides for .NET。只需確保您具有以下先決條件。

  • Microsoft Windows 或兼容 .NET Framework、.NET Core、Windows Azure、Mono 或 Xamarin 平台的操作系統
  • Microsoft Visual Studio 等開發環境
  • 項目中引用的 .NET 的 Aspose.Slides
 

C# 示例代碼查看 PPTX 文件


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);
 
  • 關於 Aspose.Slides for .NET API

    Aspose.Slides API 可用於讀取、寫入、操作 Microsoft PowerPoint 文檔並將其轉換為 PDF、XPS、HTML、TIFF、ODP 和各種其他格式。可以從頭開始創建新文件並將其保存為相關支持的格式。 Aspose.Slides 是一個獨立的 API,用於創建、解析或操作演示文稿、幻燈片和元素,它不依賴於 Microsoft 或 OpenOffice 等任何軟件。

    Free App to View PPTX

    Check our live demos to View PPTX with following benefits.

      No need to download or setup anything
      No need to write or compile code
      Just upload PPTX file and hit the "View" button
      Download PPTX file from the link, if required

    PPTX 什麼是 PPTX 文件格式

    Files with PPTX extension are presentation files created with popular Microsoft PowerPoint application. Unlike the previous version of presentation file format PPT which was binary, the PPTX format is based on the Microsoft PowerPoint open XML presentation file format. A presentation file is a collection of slides where each slide can comprise of text, images, formatting, animations, and other media. These slides are presented to audience in the form of slideshows with custom presentation settings.

    閱讀更多

    其他支持的查看器格式

    使用 C#,還可以查看許多其他文件格式,包括。

    ODP (OpenDocument 演示格式)
    OTP (OpenDocument 標準格式)
    POT (Microsoft PowerPoint 模板文件)
    POTM (微軟 PowerPoint 模板文件)
    POTX (Microsoft PowerPoint 模板演示文稿)
    PPS (幻燈片放映)
    PPSM (啟用宏的幻燈片放映)
    PPSX (幻燈片放映)
    PPT (微軟PowerPoint 97-2003)
    PPTM (啟用宏的演示文件)