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

.NET 的 ODP 文件查看器

無需 Microsoft PowerPoint 或 Office 自動化即可查看 ODP 等演示文件

如何使用 C# 查看 ODP 文件

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

Aspose.Slides for .NET

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

NuGet

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

包管理器控制台命令


PM> Install-Package Aspose.Slides.NET

通過 C# 查看 ODP 的步驟

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

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

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

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

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

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

系統要求

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

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

C#查看ODP文件的示例代碼


string output = System.IO.Path.GetTempPath() + Guid.NewGuid().ToString() + ".html";

// instantiate a Presentation object & load the ODP file
using (var presentation = new Aspose.Slides.Presentation("templateodp"))
{
    // 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 ODP

    Check our live demos to View ODP with following benefits.

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

    ODP 什麼是 ODP 文件格式

    Files with ODP extension represent presentation file format used by OpenOffice.org in the OASISOpen standard. 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. ODP files can be opened by applications that conform to the OpenDocument format (such as OpenOffice or StarOffice).

    閱讀更多

    其他支持的查看器格式

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

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