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