当前位置:网站首页>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】
效果图:
边栏推荐
猜你喜欢
大咖云集|NextArch基金会云开发Meetup来啦!
Command injection of cisp-pte
解密函数计算异步任务能力之「任务的状态及生命周期管理」
Dall-E Mini的Mega版本模型发布,已开放下载
Vingt - trois mille feuilles? "Yang mou" derrière l'explosion de la consommation végétale
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!
#夏日挑战赛#数据库学霸笔记(下)~
MySQL execution process and sequence
处理streamlit库上传的图片文件
Blackfly S USB3工业相机:缓冲区处理
随机推荐
[paper reading | deep reading] rolne: improving the quality of network embedding with structural role proximity
2022 system integration project management engineer examination knowledge point: Mobile Internet
3D laser slam: time synchronization of livox lidar hardware
Unicode string converted to Chinese character decodeunicode utils (tool class II)
A new path for enterprise mid Platform Construction -- low code platform
Livox激光雷达硬件时间同步---PPS方法
FLIR blackfly s industrial camera: explanation and configuration of color correction and code setting method
FLIR blackfly s industrial camera: synchronous shooting of multiple cameras through external trigger
New generation cloud native message queue (I)
Draco - glTF模型压缩利器
Jacob Steinhardt, assistant professor of UC Berkeley, predicts AI benchmark performance: AI has made faster progress in fields such as mathematics than expected, but the progress of robustness benchma
将截断字符串或二进制数据
【Unity】升级版·Excel数据解析,自动创建对应C#类,自动创建ScriptableObject生成类,自动序列化Asset文件
使用Ceres进行slam必须要弄清楚的几个类和函数
Decryption function calculates "task state and lifecycle management" of asynchronous task capability
Redis configuration class redisconfig
Schedulx v1.4.0 and SaaS versions are released, and you can experience the advanced functions of cost reduction and efficiency increase for free!
强化学习如何用于医学影像?埃默里大学最新《强化学习医学影像分析》综述,阐述最新RL医学影像分析概念、应用、挑战与未来方向
pgpool-II和pgpoolAdmin的使用
Flir Blackfly S USB3 工业相机:白平衡设置方法