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