当前位置:网站首页>C#/VB.NET 删除Word文檔中的水印
C#/VB.NET 删除Word文檔中的水印
2022-07-07 02:24:00 【51CTO】
在Word文檔中添加的水印,如文本水印或圖像水印,可以有效地錶明所有權,還可以起到一定的警示效果。但是如果想删除這些水印該怎麼辦呢?本文將提供一種删除Word文檔中水印的方法。此方法對删除文字水印和圖片水印均適用。 下面是詳細的方法和步驟。
程序環境
本次測試時,在程序中引入 Free Spire.Doc for .NET。可通過以下方法引用Spire.Doc.dll文件:
方法1:將 Free Spire.Doc for .NET 下載到本地,解壓,安裝。安裝完成後,找到安裝路徑下BIN文件夾中的Spire.Doc.dll。然後在Visual Studio中打開“解决方案資源管理器”,鼠標右鍵點擊“引用”,“添加引用”,將本地路徑BIN文件夾下的dll文件添加引用至程序。
方法2:通過 NuGet安裝。可通過以下2種方法安裝:
(1)可以在Visual Studio中打開“解决方案資源管理器”,鼠標右鍵點擊“引用”,“管理NuGet包”,然後搜索“Free Spire.Doc”,點擊“安裝”。等待程序安裝完成。
(2)將以下內容複制到PM控制臺安裝。
Install-Package FreeSpire.Doc -Version 10.2.0
具體步驟:
- 初始化 Document 類的一個實例。
- 調用 Document.LoadFromFile(string fileName, FileFormat fileFormat) 方法加載 Word 文檔。
- 將 Document.Watermark 屬性設置為 null。
- 通過 Document.SaveToFile(string fileName, FileFormat fileFormat) 方法保存結果文檔到指定路徑。
完整代碼:
【C#】
【VB.NET】
效果圖:
边栏推荐
- 1500万员工轻松管理,云原生数据库GaussDB让HR办公更高效
- 猿桌派第三季开播在即,打开出海浪潮下的开发者新视野
- Zhang Ping'an: accelerate cloud digital innovation and jointly build an industrial smart ecosystem
- How can reinforcement learning be used in medical imaging? A review of Emory University's latest "reinforcement learning medical image analysis", which expounds the latest RL medical image analysis co
- #yyds干货盘点# 解决名企真题:最大差值
- Processing image files uploaded by streamlit Library
- Introduction to the internal structure of the data directory of PostgreSQL
- GEE升级,可以实现一件run tasks
- 阿里云中间件开源往事
- The empirical asset pricing package (EAP) can be installed through pypi
猜你喜欢
传感器:土壤湿度传感器(XH-M214)介绍及stm32驱动代码
Stm32f4 --- PWM output
How can reinforcement learning be used in medical imaging? A review of Emory University's latest "reinforcement learning medical image analysis", which expounds the latest RL medical image analysis co
Word wrap when flex exceeds width
[paper reading | deep reading] graphsage:inductive representation learning on large graphs
The boss is quarantined
Zhang Ping'an: accelerate cloud digital innovation and jointly build an industrial smart ecosystem
SchedulX V1.4.0及SaaS版发布,免费体验降本增效高级功能!
大咖云集|NextArch基金会云开发Meetup来啦!
[paper reading | deep reading] anrl: attributed network representation learning via deep neural networks
随机推荐
将截断字符串或二进制数据
Correct use of BigDecimal
UC伯克利助理教授Jacob Steinhardt预测AI基准性能:AI在数学等领域的进展比预想要快,但鲁棒性基准性能进展较慢
The cities research center of New York University recruits master of science and postdoctoral students
#yyds干货盘点# 解决名企真题:最大差值
传感器:DS1302时钟芯片及驱动代码
Lidar: introduction and usage of ouster OS
Flir Blackfly S工业相机:颜色校正讲解及配置与代码设置方法
豆瓣平均 9.x,分布式领域的 5 本神书!
Integrated navigation: product description and interface description of zhonghaida inav2
Overall query process of PostgreSQL
Tiflash source code reading (IV) design and implementation analysis of tiflash DDL module
The mega version model of dall-e MINI has been released and is open for download
Processus général de requête pour PostgreSQL
Stm32f4 --- PWM output
Web开发小妙招:巧用ThreadLocal规避层层传值
Schedulx v1.4.0 and SaaS versions are released, and you can experience the advanced functions of cost reduction and efficiency increase for free!
String or binary data will be truncated
FLIR blackfly s industrial camera: auto exposure configuration and code
This week's hot open source project!