当前位置:网站首页>C#/VB.NET 删除Word文檔中的水印
C#/VB.NET 删除Word文檔中的水印
2022-07-07 02:24: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】
效果圖:
边栏推荐
- FLIR blackfly s industrial camera: auto exposure configuration and code
- Overall query process of PostgreSQL
- STM32项目 -- 选题分享(部分)
- New generation cloud native message queue (I)
- postgresql之integerset
- 云原生混部最后一道防线:节点水位线设计
- [leetcode] day97 remove linked list elements
- Vingt - trois mille feuilles? "Yang mou" derrière l'explosion de la consommation végétale
- 1--新唐nuc980 NUC980移植 UBOOT,从外部mx25l启动
- Sensor: DS1302 clock chip and driver code
猜你喜欢
Introduction to microservice architecture
Lidar: introduction and usage of ouster OS
Flir Blackfly S 工业相机:通过外部触发实现多摄像头同步拍摄
Infrared camera: juge infrared mag32 product introduction
3D laser slam: time synchronization of livox lidar hardware
Introduction to FLIR blackfly s industrial camera
Blackfly S USB3工业相机:缓冲区处理
[paper reading | deep reading] rolne: improving the quality of network embedding with structural role proximity
将截断字符串或二进制数据
阿里云中间件开源往事
随机推荐
Introduction to microservice architecture
Introduction to RC oscillator and crystal oscillator
The cities research center of New York University recruits master of science and postdoctoral students
[paper reading | deep reading] rolne: improving the quality of network embedding with structural role proximity
【论文阅读|深读】RolNE: Improving the Quality of Network Embedding with Structural Role Proximity
机器人队伍学习方法,实现8.8倍的人力回报
阿里云易立:云原生如何破解企业降本提效难题?
Introduction to FLIR blackfly s industrial camera
企业中台建设新路径——低代码平台
1--新唐nuc980 NUC980移植 UBOOT,从外部mx25l启动
Chang'an chain learning notes - certificate model of certificate research
新一代云原生消息队列(一)
张平安:加快云上数字创新,共建产业智慧生态
[server data recovery] data recovery case of a Dell server crash caused by raid damage
Why am I warned that the 'CMAKE_ TOOLCHAIN_ FILE' variable is not used by the project?
人脸识别应用解析
豆瓣平均 9.x,分布式领域的 5 本神书!
阿里云中间件开源往事
freeswitch拨打分机号源代码跟踪
Web开发小妙招:巧用ThreadLocal规避层层传值