当前位置:网站首页>C#/VB.NET 删除Word文档中的水印
C#/VB.NET 删除Word文档中的水印
2022-07-06 18:41: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】
效果图:

边栏推荐
- Stm32f4 --- general timer update interrupt
- postgresql 之 数据目录内部结构 简介
- 云原生混部最后一道防线:节点水位线设计
- 长安链学习笔记-证书研究之证书模式
- ZABBIX 5.0: automatically monitor Alibaba cloud RDS through LLD
- 组合导航:中海达iNAV2产品描述及接口描述
- [server data recovery] data recovery case of a Dell server crash caused by raid damage
- Input and output of C language pointer to two-dimensional array
- Robot team learning method to achieve 8.8 times human return
- 新一代云原生消息队列(一)
猜你喜欢

Stm32f4 --- general timer update interrupt

Introduction to FLIR blackfly s industrial camera

如何从0到1构建32Core树莓派集群

Twenty or thirty thousand a leaf? "Yang Mou" behind the explosion of plant consumption

Recommended collection!! Which is the best flutter status management plug-in? Please look at the ranking list of yard farmers on the island!

Processus général de requête pour PostgreSQL

Schedulx v1.4.0 and SaaS versions are released, and you can experience the advanced functions of cost reduction and efficiency increase for free!

Collection recommandée!! Quel plug - in de gestion d'état flutter est le plus fort? Regardez le classement des manons de l'île, s'il vous plaît!

Web3对法律的需求

Cat recycling bin
随机推荐
SchedulX V1.4.0及SaaS版发布,免费体验降本增效高级功能!
Flir Blackfly S工业相机:颜色校正讲解及配置与代码设置方法
处理streamlit库上传的图片文件
Recent applet development records
Schedulx v1.4.0 and SaaS versions are released, and you can experience the advanced functions of cost reduction and efficiency increase for free!
Introduction to the internal structure of the data directory of PostgreSQL
How do I dump SoapClient requests for debugging- How to dump SoapClient request for debug?
张平安:加快云上数字创新,共建产业智慧生态
Unicode string converted to Chinese character decodeunicode utils (tool class II)
阿里云易立:云原生如何破解企业降本提效难题?
Stm32f4 --- PWM output
RC振荡器和晶体振荡器简介
[paper reading | deep reading] anrl: attributed network representation learning via deep neural networks
MFC Windows 程序设计[147]之ODBC数据库连接(附源码)
传感器:DS1302时钟芯片及驱动代码
企业中台建设新路径——低代码平台
Infrared camera: juge infrared mag32 product introduction
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
Lumion 11.0软件安装包下载及安装教程
长安链学习笔记-证书研究之证书模式