文檔半島外圍網上直營>>E-iceblue中文文檔>>從 Word 文檔中刪除文本或圖像水印
                從 Word 文檔中刪除文本或圖像水印
可以將水印添加到 Word 文檔中,以告知其他人文檔的所有權或狀態。有時,您可能希望刪除 Word 文檔中的現有水印。本文將演示如何使用Spire.Doc for .NET從 C# 和 VB.NET 中的 Word 文檔中刪除水印。
為 .NET 安裝 Spire.Doc
首先,您需要添加 Spire.Doc for .NET 包中包含的 DLL 文件作為 .NET 項目中的引用。DLL 文件可以從此鏈接下載或通過NuGet安裝。
PM> Install-Package Spire.Doc
從 C# 和 VB.NET 中的 Word 文檔中刪除文本或圖像水印
您可以通過將Document.Watermark屬性設置為 null來刪除 Word 文檔的水印。
以下步驟向您展示如何從 Word 文檔中刪除水印:
- 初始化Document類的一個實例。
- 使用Document.LoadFromFile()方法加載 Word 文檔。
- 通過將Document.Watermark屬性設置為 null從文檔中刪除水印。
- 使用Document.SaveToFile()方法保存結果文檔。
【C#】
using Spire.Doc;
namespace RemoveWatermark
{
class Program
{
static void Main(string[] args)
{
//Create a Document instance
Document doc = new Document();
//Load a Word document
doc.LoadFromFile("Sample.docx");
//Remove the watermark from the document
doc.Watermark = null;
//Save the result document
doc.SaveToFile("RemoveWatermark.docx", FileFormat.Docx2013);
}
}
}
【VB.NET】
using Spire.Doc;
namespace RemoveWatermark
{
class Program
{
static void Main(string[] args)
{
//Create a Document instance
Document doc = new Document();
//Load a Word document
doc.LoadFromFile("Sample.docx");
//Remove the watermark from the document
doc.Watermark = null;
//Save the result document
doc.SaveToFile("RemoveWatermark.docx", FileFormat.Docx2013);
}
}
}
  
 
					

 QQ交談
QQ交談 在線咨詢
在線咨詢 
                 
                
 渝公網安備
            50010702500608號
渝公網安備
            50010702500608號
             
            
 客服熱線
客服熱線