翻譯|使用教程|編輯:胡濤|2022-07-13 11:07:24.417|閱讀 190 次
概述:本文將演示如何使用Spire.Doc for .NET從 C# 和 VB.NET 中的 Word 文檔中刪除水印。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
可以將水印添加到 Word 文檔中,以告知其他人文檔的所有權或狀態。有時,您可能希望刪除 Word 文檔中的現有水印。本文將演示如何使用Spire.Doc for .NET從 C# 和 VB.NET 中的 Word 文檔中刪除水印。
首先,您需要添加 Spire.Doc for .NET 包中包含的 DLL 文件作為 .NET 項目中的引用。DLL 文件可以從此鏈接下載或通過NuGet安裝。
PM> Install-Package Spire.Doc
您可以通過將Document.Watermark屬性設置為 null來刪除 Word 文檔的水印。
以下步驟向您展示如何從 Word 文檔中刪除水?。?
【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); } } }
歡迎下載|體驗更多E-iceblue產品
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn