PPTX DOCX XLSX PDF ODP
Aspose.Slides  for .NET
PPT

通過 C# 將文本水印添加到 PPT

使用服務器端 API 構建您自己的 .NET 應用程序來為 PPT 文件添加水印。

如何使用 C# 給 PPT 文件加水印

為了給 PPT 文件加水印,我們將使用

Aspose.Slides for .NET

API 是一個功能豐富、功能強大且易於使用的 C# 平台文檔操作 API。打開

NuGet

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

命令


PM> Install-Package Aspose.Slides.NET

通過 C# 給 PPT 添加水印的步驟

您需要 aspose.slides.dll 在您自己的環境中嘗試以下工作流程。

  1. 創建 Presentation 類的實例

  2. 選擇主演示文稿

  3. 使用 AddAutoShape 添加形狀類型

  4. 使用 AddTextFrame 添加水印文本

系統要求

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

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

給 PPT 添加水印 - C#


// create a Presentation from scratch
using (var presentation = new Aspose.Slides.Presentation())
{
    // get the Master Slide to add watermark on all slides
    var master = presentation.Masters[0];
    // add a new shape using IShapeColection.AddAutoShape
    var shape = master.Shapes.AddAutoShape(Aspose.Slides.ShapeType.Triangle, 0, 0, 0, 0);
    // set watermark text
    shape.AddTextFrame("CONFIDENTIAL");
    // save presentation in PPT format
    presentation.Save("output.ppt", Aspose.Slides.Export.SaveFormat.Ppt);
}  
 
  • 關於 Aspose.Slides for .NET API

    Aspose.Slides API 可用於讀取、寫入、操作 Microsoft PowerPoint 文檔並將其轉換為 PDF、XPS、HTML、TIFF、ODP 和各種其他格式。可以從頭開始創建新文件並將其保存為相關支持的格式。 Aspose.Slides 是一個獨立的 API,用於創建、解析或操作演示文稿、幻燈片和元素,它不依賴於 Microsoft 或 OpenOffice 等任何軟件。

    Watermark PPT via Online App

    Add watermark to PPT documents by visiting our Live Demos website . The live demo has the following benefits

      No need to download or setup anything
      No need to write any code
      Just upload your PPT file, set your watermark and hit "Add" button
      Instantly get the download link for the resultant file

    PPT 什麼是 PPT 文件格式

    A file with PPT extension represents PowerPoint file that consists of a collection of slides for displaying as SlideShow. It specifies the Binary File Format used by Microsoft PowerPoint 97-2003. A PPT file can contain several different types of information such as text, bulleted points, images, multimedia and other embedded OLE objects. Microsoft came up with newer file format for PowerPoint, known as PPTX, from 2007 onwards that is based on Office OpenXML and is different from this binary file format. Several other application programs such as OpenOffice Impress and Apple Keynote can also create PPT files.

    閱讀更多

    其他支持的水印格式

    使用 C#,可以輕鬆地為不同的格式添加水印,包括。

    PPTX (打開 XML 表示格式)