在 C# .NET 中编辑 OTP

使用用于 C# .NET API 的服务器端 GroupDocs.Editor 进行有效且强大的 OTP 编辑,无需使用 Microsoft 或 Open Office 等任何软件。


下载免费试用版

关于 GroupDocs.Editor for .NET API

GroupDocs.Editor for .NET API 是编辑 Microsoft Word、Excel、PowerPoint、Open Office 文档和演示文稿的正确选择。 GroupDocs.Editor 是一个独立的 API,适用于需要高性能的服务器端和后端系统。它不依赖于任何软件,如 Microsoft 或 Open Office。

在 C# 中编辑 OTP 的步骤

GroupDocs.Editor for .NET 为开发人员提供了一种使用几行代码编辑 OTP 文件的简单直接的方法。

  • 使用强制文件路径或字节流和可选的 PresentationLoadOptions 类创建 Editor 类的实例并加载 OTP 文件
  • 为 OTP 文件格式创建和设置 PresentationEditOptions 类实例
  • 调用 Editor.Edit() 方法并获得 HTML 格式的 OTP 文档,该文档可以使用任何所见即所得的编辑器轻松编辑。
  • 调用 Editor.Save() 方法并使用 PresentationSaveOptions 类保存编辑的 OTP 文件

系统要求

使用 GroupDocs.Editor for .NET API 进行基本文档编辑可以通过几个简单的步骤来完成。所有主要平台和操作系统都支持我们的 API。在执行以下代码之前,请确保您的系统上安装了以下先决条件。

  • 操作系统:Microsoft Windows、Linux、MacOS
  • 开发环境:Microsoft Visual Studio, Xamarin, MonoDevelop
  • 构架: .NET Framework, .NET Standard, .NET Core, Mono
  • 获取从 NuGet 下载的最新版本 GroupDocs.Editor for .NET

// Load the OTP file into Editor with the optional PresentationLoadOptions
Editor editor = new Editor("source.otp", delegate { return new PresentationLoadOptions(); });

// Create and adjust the edit options
PresentationEditOptions editOptions = new PresentationEditOptions();
editOptions.SlideNumber = 1;//select a slide to edit

// Open input OTP document for edit — obtain an intermediate document, that can be edited
EditableDocument beforeEdit = editor.Edit(editOptions);

// Grab OTP document content and associated resources from editable document
string content = beforeEdit.GetEmbeddedHtml();

// Send the content to WYSIWYG-editor, edit it there, and send edited content back to the server-side
// This step simulates a such operation
string updatedContent = content.Replace("Title", "Edited Title");

// Grab edited content and resources from WYSIWYG-editor and create a new EditableDocument instance from it
EditableDocument afterEdit = EditableDocument.FromMarkup(updatedContent, null);

// Create a save options and select a desired output format
PresentationSaveOptions saveOptions = new PresentationSaveOptions(Formats.PresentationFormats.Otp);

// Save edited OTP document to the file
editor.Save(afterEdit, "edited.otp", saveOptions);

OTP 编辑器现场演示

立即访问 GroupDocs.Editor 现场演示 网站编辑 OTP。 现场演示有以下好处

无需下载 API

无需编写任何代码

只需上传源文件

获取下载链接以保存文件

其他支持的编辑器

您还可以编辑其他文件格式。请参阅下面的完整列表。

Back to top
 中国人