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

边栏推荐
- 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
- Date processing tool class dateutils (tool class 1)
- Flir Blackfly S 工业相机:通过外部触发实现多摄像头同步拍摄
- 低代码平台中的数据连接方式(上)
- 企业中台建设新路径——低代码平台
- FLIR blackfly s industrial camera: configure multiple cameras for synchronous shooting
- Chang'an chain learning notes - certificate model of certificate research
- 机器人队伍学习方法,实现8.8倍的人力回报
- Robot team learning method to achieve 8.8 times human return
- 【森城市】GIS数据漫谈(二)
猜你喜欢

本周 火火火火 的开源项目!

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!

Flir Blackfly S 工业相机:配置多个摄像头进行同步拍摄

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

Livox激光雷达硬件时间同步---PPS方法

Lumion 11.0 software installation package download and installation tutorial

Blackfly s usb3 industrial camera: buffer processing

一片葉子兩三萬?植物消費爆火背後的“陽謀”

Lombok同时使⽤@Data和@Builder 的坑

处理streamlit库上传的图片文件
随机推荐
#夏日挑战赛#数据库学霸笔记(下)~
Sensor: introduction of soil moisture sensor (xh-m214) and STM32 drive code
张平安:加快云上数字创新,共建产业智慧生态
[paper reading | deep reading] dngr:deep neural networks for learning graph representations
Sensor: DS1302 clock chip and driver code
A new path for enterprise mid Platform Construction -- low code platform
Lidar: introduction and usage of ouster OS
The GPG keys listed for the "MySQL 8.0 community server" repository are already ins
【论文阅读|深读】DNGR:Deep Neural Networks for Learning Graph Representations
Cat recycling bin
长安链学习笔记-证书研究之证书模式
Decryption function calculates "task state and lifecycle management" of asynchronous task capability
3D激光SLAM:Livox激光雷达硬件时间同步
Chang'an chain learning notes - certificate model of certificate research
组合导航:中海达iNAV2产品描述及接口描述
【论文阅读|深读】ANRL: Attributed Network Representation Learning via Deep Neural Networks
FLIR blackfly s usb3 industrial camera: how to use counters and timers
Data connection mode in low code platform (Part 1)
What to do when encountering slow SQL? (next)
STM32F4---通用定时器更新中断