PNG JPG BMP TIFF OTP
Aspose.Slides  for .NET

在 C# 中合并 OTP 格式

使用用于 .NET API 的服务器端 Aspose.Slides 进行本机和高性能 OTP 文档合并,无需使用 Microsoft 或 Open Office、Adobe PDF 等任何软件。

如何使用 C# 合并 OTP 文件

为了合并 OTP 文件,我们将使用

Aspose.Slides for .NET

API 是一个功能丰富、功能强大且易于使用的 C# 平台文档操作和合并 API。打开

NuGet

包管理器,搜索 Aspose.Slides 并安装。您还可以从包管理器控制台使用以下命令。

命令


PM> Install-Package Aspose.Slides.NET

在 C# 中合并 OTP 文件的步骤

只需几行代码即可完成与 Aspose.Slides for .NET API 合并和连接的基本文档。

  1. 使用完整路径加载所有 OTP 文件。

  2. 制作一份文件作为基础文件

  3. 调用相关方法一一拼接合并文件。

  4. 调用 Save() 方法并将文件名(完整路径)和格式(OTP)作为参数传递。

  5. 现在您可以在 Microsoft Office、Adobe PDF 或任何其他兼容程序中打开和使用 OTP 文件。

系统要求

所有主要平台和操作系统都支持我们的 API。在执行以下代码之前,请确保您的系统具有以下先决条件。

  • Microsoft Windows 或兼容 .NET Framework、.NET Core、Windows Azure、Mono 或 Xamarin 平台的操作系统
  • Microsoft Visual Studio 等开发环境
  • 项目中引用的 .NET DLL 的 Aspose.Slides - 使用上面的下载按钮从 NuGet 安装
 

合并 OTP 文件 - C#

var ps1 = new Presentation("presen1.otp");
    var ps2 = new Presentation("presen2.pptx");
    
    //merged Presentation 
    var mp = new Presentation("template.pptx");
    while (mp.Slides.Count > 0){
        mp.Slides.RemoveAt(0);
    }
    // master slide
    var ms = mp.Masters[0];
    
    // The first OTP presentation is added with its own styles.
    foreach (var slide in ps1.Slides){
        mp.Slides.AddClone(slide);
    }
    
    // The second PPTX presentation is added with template presentation styles using.
    foreach (var slide in ps2.Slides){
        mp.Slides.AddClone(slide, ms, true);
    }
    
    // It is possible to save the merged presentation to any supported format.
    mp.Save("mp.pptx", SaveFormat.Pptx);
    mp.Save("mp.pptx", SaveFormat.Pdf);  

    
 
  • 在线合并 PDF 文件

    如何在 Python 中合并 PDF

    关于 Aspose.Slides for .NET API

    Aspose.Slides API 可用于读取、编写、操作 Microsoft PowerPoint 文档并将其转换为 PDF、XPS、HTML、TIFF、ODP 和各种其他格式。可以从头开始创建新文件并将其保存为相关支持的格式。 Aspose.Slides 是一个独立的 API,用于创建、解析或操作演示文稿、幻灯片和元素,它不依赖于 Microsoft 或 OpenOffice 等任何软件。

    Online OTP Merger Live Demos

    Merge OTP documents right now by visiting our Live Demos website . The live demo has the following benefits

      No need to download Aspose API.
      No need to write any code.
      Just upload your OTP files.
      It will be merged and concatenated instantly.

    OTP 什么是OTP文件格式

    Files with .OTP extension represent presentation template files created by applications in OASIS OpenDocument standard format. The contents of such a file include presentation information in the form of slides with text, images, shapes, multimedia content, transition effects and other slide elements. These template files are used for creating new presentations quickly based on the styling information stored in the template itself. OTP files can be created and saved with several different applications such as Impress that comes with OpenOffice suite and Microsoft PowerPoint. The OTP file format is similar to Microsoft PowerPoint template files .POT and .POTX.

    阅读更多

    其他支持的合并格式

    使用 C#,One 还可以合并许多其他文件格式,包括。

    ODP (OpenDocument 演示格式)
    POT (Microsoft PowerPoint 模板文件)
    POTM (微软 PowerPoint 模板文件)
    POTX (Microsoft PowerPoint 模板演示文稿)
    PPS (幻灯片放映)
    PPSM (启用宏的幻灯片放映)
    PPSX (幻灯片放映)
    PPT (微软PowerPoint 97-2003)
    PPTM (启用宏的演示文件)
    PPTX (打开 XML 表示格式)