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 表示格式)