当前位置: 首页 > news >正文

Aspose.Pdf使用教程:在PDF文件中添加水印

Aspose.PDF 是一款高级PDF处理API,可以在跨平台应用程序中轻松生成,修改,转换,呈现,保护和打印文档。无需使用Adobe Acrobat。此外,API提供压缩选项,表创建和处理,图形和图像功能,广泛的超链接功能,图章和水印任务,扩展的安全控件和自定义字体处理。本文将为你介绍如何在 C++ 中将PDF转换为Doc 、Docx 。

Aspose API支持流行文件格式处理,并允许将各类文档导出或转换为固定布局文件格式和最常用的图像/多媒体格式。 

Aspose.pdf 最新下载(qun:761297826)icon-default.png?t=N3I4https://www.evget.com/product/4118/download

使用Aspose.pdf 的OutlineItemCollection,就可以在PDF文件中添加水印。首先需要使用Document对象打开PDF文件,之后就可以在Document对象的Outlines集合中添加OutlineItemCollection。不过要注意在添加OutlineItemCollection之前,需要先设置水印的属性。

下面的代码片段演示了如何在PDF文件中添加水印。

C#

//open document
Document pdfDocument = new Document("input.pdf");
//create a bookmark object
OutlineItemCollection pdfOutline = new OutlineItemCollection(pdfDocument.Outlines);
pdfOutline.Title = "Test Outline";
pdfOutline.Italic = true;
pdfOutline.Bold = true;
//set the destination page number
pdfOutline.Action = new Aspose.Pdf.InteractiveFeatures.GoToAction(doc.Pages[1]);
//add bookmark in the document's outline collection.
pdfDocument.Outlines.Add(pdfOutline);
//save output
pdfDocument.Save("output.pdf");

VB.NET

'open document
Dim pdfDocument As New Document("input.pdf")
'create a bookmark object
Dim pdfOutline As New OutlineItemCollection(pdfDocument.Outlines)
pdfOutline.Title = "Test Outline"
pdfOutline.Italic = True
pdfOutline.Bold = True
'set the destination page number
pdfOutline.Action = New Aspose.Pdf.InteractiveFeatures.GoToAction(doc.Pages(1))
'add bookmark in the document's outline collection.
pdfDocument.Outlines.Add(pdfOutline)
'save output
pdfDocument.Save("output.pdf")

 以上边是如何在PDF文件中添加水印,欢迎评论区交流,如有其他软件相关的问题欢迎私聊我~

http://www.lryc.cn/news/62983.html

相关文章:

  • H.264/AVC加密----选择加密
  • WuThreat身份安全云-TVD每日漏洞情报-2023-04-26
  • 剑指 Offer第二版:1~n 整数中 1 出现的次数、51. 数组中的逆序对、56 - II. 数组中数字出现的次数 II
  • 云原生-k8s核心概念(pod,deploy,service,ingress,configmap,volume)
  • 他工作10年,老板却让他走人
  • vpp怎么写node
  • 【4. ROS的主要通讯方式:Topic话题与Message消息】
  • 【react全家桶学习】react中组件定义及state属性(超详/必看)
  • 如何以产品经理思维打造一所高品质学校?
  • 根治Spring中使用Mongo时报错InvalidMongoDbApiUsageException
  • 【计算机组成原理】数据的表示和运算·进位计数制
  • C++ Primer第五版_第十四章习题答案(21~30)
  • 服务器性能调优
  • 带你深入学习k8s--(三) pod 管理
  • 前端系列11集-ES6 知识总结
  • 连接分析工具箱 | 利用CATO进行结构和功能连接重建
  • 【目标检测论文阅读笔记】Detection of plane in remote sensing images using super-resolution
  • 外卖app开发流程全解析
  • BUUCTF jarvisoj_level0
  • 网络安全之入侵检测
  • 元数据管理
  • C# WebService的开发以及客户端调用
  • 有符号数和无符号数左移和右移
  • Netty小白入门教程
  • 【逻辑位移和算数位移】
  • Blender3.5 边的操作
  • Java与Python、Node.js在人工智能和区块链应用程序开发中的比较
  • 【计算机是怎么跑起来的】基础:计算机三大原则
  • NXP公司LPC21XX+PID实现稳定温度控制
  • 【CE实战-生化危机4重置版】实现角色瞬移、飞翔