当前位置:网站首页>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】
效果图:
边栏推荐
- 豆瓣平均 9.x,分布式领域的 5 本神书!
- Flir Blackfly S USB3 工业相机:白平衡设置方法
- Centros 8 installation MySQL Error: The gpg Keys listed for the "MySQL 8.0 Community Server" repository are already ins
- [leetcode] day97 remove linked list elements
- Vingt - trois mille feuilles? "Yang mou" derrière l'explosion de la consommation végétale
- Schedulx v1.4.0 and SaaS versions are released, and you can experience the advanced functions of cost reduction and efficiency increase for free!
- Tiflash source code reading (IV) design and implementation analysis of tiflash DDL module
- 云原生混部最后一道防线:节点水位线设计
- Web开发小妙招:巧用ThreadLocal规避层层传值
- Lombok同时使⽤@Data和@Builder 的坑
猜你喜欢
传感器:土壤湿度传感器(XH-M214)介绍及stm32驱动代码
Introduction to microservice architecture
将截断字符串或二进制数据
postgresql之integerset
A new path for enterprise mid Platform Construction -- low code platform
Time synchronization of livox lidar hardware -- PPS method
Detailed explanation of line segment tree (including tested code implementation)
3--新唐nuc980 kernel支持jffs2, Jffs2文件系统制作, 内核挂载jffs2, uboot网口设置,uboot支持tftp
[paper reading | deep reading] graphsage:inductive representation learning on large graphs
TiFlash 源码阅读(四)TiFlash DDL 模块设计及实现分析
随机推荐
Unicode string converted to Chinese character decodeunicode utils (tool class II)
Sensor: introduction of soil moisture sensor (xh-m214) and STM32 drive code
老板被隔离了
Flir Blackfly S 工业相机:通过外部触发实现多摄像头同步拍摄
将截断字符串或二进制数据
Chang'an chain learning notes - certificate model of certificate research
Data connection mode in low code platform (Part 1)
张平安:加快云上数字创新,共建产业智慧生态
Web开发小妙招:巧用ThreadLocal规避层层传值
Stm32f4 --- PWM output
The empirical asset pricing package (EAP) can be installed through pypi
传感器:土壤湿度传感器(XH-M214)介绍及stm32驱动代码
FLIR blackfly s usb3 industrial camera: how to use counters and timers
FLIR blackfly s industrial camera: configure multiple cameras for synchronous shooting
3D激光SLAM:Livox激光雷达硬件时间同步
[paper reading | deep reading] graphsage:inductive representation learning on large graphs
MetaForce原力元宇宙开发搭建丨佛萨奇2.0系统开发
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
Cisp-pte practice explanation (II)
使用Ceres进行slam必须要弄清楚的几个类和函数