当前位置:网站首页>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】
效果圖:
边栏推荐
- go swagger使用
- Lumion 11.0软件安装包下载及安装教程
- postgresql之整體查詢大致過程
- Zabbix 5.0:通过LLD方式自动化监控阿里云RDS
- SchedulX V1.4.0及SaaS版发布,免费体验降本增效高级功能!
- The empirical asset pricing package (EAP) can be installed through pypi
- Infrared camera: juge infrared mag32 product introduction
- [paper reading | deep reading] anrl: attributed network representation learning via deep neural networks
- Vingt - trois mille feuilles? "Yang mou" derrière l'explosion de la consommation végétale
- 4--新唐nuc980 挂载initramfs nfs文件系统
猜你喜欢
Web3的先锋兵:虚拟人
处理streamlit库上传的图片文件
Lumion 11.0 software installation package download and installation tutorial
强化学习如何用于医学影像?埃默里大学最新《强化学习医学影像分析》综述,阐述最新RL医学影像分析概念、应用、挑战与未来方向
企业中台建设新路径——低代码平台
建议收藏!!Flutter状态管理插件哪家强?请看岛上码农的排行榜!
豆瓣平均 9.x,分布式领域的 5 本神书!
阿里云易立:云原生如何破解企业降本提效难题?
1--新唐nuc980 NUC980移植 UBOOT,从外部mx25l启动
一片葉子兩三萬?植物消費爆火背後的“陽謀”
随机推荐
15million employees are easy to manage, and the cloud native database gaussdb makes HR office more efficient
Zhang Ping'an: accelerate cloud digital innovation and jointly build an industrial smart ecosystem
投资的再思考
Redis tool class redisutil (tool class III)
Infrared camera: juge infrared mag32 product introduction
Zhang Ping'an: accelerate cloud digital innovation and jointly build an industrial smart ecosystem
pgpool-II和pgpoolAdmin的使用
本周 火火火火 的开源项目!
Web3对法律的需求
一片葉子兩三萬?植物消費爆火背後的“陽謀”
Integerset of PostgreSQL
Introduction to the internal structure of the data directory of PostgreSQL
红外相机:巨哥红外MAG32产品介绍
纽约大学 CITIES 研究中心招聘理学硕士和博士后
[server data recovery] data recovery case of a Dell server crash caused by raid damage
What to do when encountering slow SQL? (next)
#夏日挑战赛#数据库学霸笔记(下)~
强化学习如何用于医学影像?埃默里大学最新《强化学习医学影像分析》综述,阐述最新RL医学影像分析概念、应用、挑战与未来方向
Schedulx v1.4.0 and SaaS versions are released, and you can experience the advanced functions of cost reduction and efficiency increase for free!
Zhang Ping'an: accelerate cloud digital innovation and jointly build an industrial smart ecosystem