当前位置:网站首页>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】
效果图:

边栏推荐
- Zhang Ping'an: accelerate cloud digital innovation and jointly build an industrial smart ecosystem
- [C # notes] reading and writing of the contents of text files
- Introduction to FLIR blackfly s industrial camera
- Zhang Ping'an: accelerate cloud digital innovation and jointly build an industrial smart ecosystem
- New generation cloud native message queue (I)
- Time synchronization of livox lidar hardware -- PPS method
- #夏日挑战赛#数据库学霸笔记(下)~
- [paper reading | deep reading] anrl: attributed network representation learning via deep neural networks
- 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
- pgpool-II和pgpoolAdmin的使用
猜你喜欢

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

1个月增长900w+播放!总结B站顶流恰饭的2个新趋势
![[unity notes] screen coordinates to ugui coordinates](/img/e4/fc18dd9b4b0e36ec3e278e5fb3fd23.jpg)
[unity notes] screen coordinates to ugui coordinates

建議收藏!!Flutter狀態管理插件哪家强?請看島上碼農的排行榜!

New generation cloud native message queue (I)

Draco - glTF模型压缩利器

STM32F4---通用定时器更新中断

Tiflash source code reading (IV) design and implementation analysis of tiflash DDL module

压缩 js 代码就用 terser

猿桌派第三季开播在即,打开出海浪潮下的开发者新视野
随机推荐
2022 system integration project management engineer examination knowledge point: Mobile Internet
postgresql 之 数据目录内部结构 简介
[server data recovery] data recovery case of a Dell server crash caused by raid damage
Tiflash source code reading (IV) design and implementation analysis of tiflash DDL module
企业中台建设新路径——低代码平台
长安链学习笔记-证书研究之证书模式
真实项目,用微信小程序开门编码实现(完结)
#夏日挑战赛#数据库学霸笔记(下)~
Big guys gather | nextarch foundation cloud development meetup is coming!
【论文阅读|深读】DNGR:Deep Neural Networks for Learning Graph Representations
机器人队伍学习方法,实现8.8倍的人力回报
leetcode:736. Lisp 语法解析【花里胡哨 + 栈 + 状态enumaotu + slots】
Flir Blackfly S 工业相机 介绍
Introduction to the internal structure of the data directory of PostgreSQL
Stm32f4 --- PWM output
XML to map tool class xmlmaputils (tool class V)
Halcon实例转OpenCvSharp(C# OpenCV)实现--瓶口缺陷检测(附源码)
[C # notes] reading and writing of the contents of text files
【森城市】GIS数据漫谈(二)
建议收藏!!Flutter状态管理插件哪家强?请看岛上码农的排行榜!