半岛外围网上直营

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

原创|使用教程|编辑:郝浩|2013-03-13 15:50:51.000|阅读 6434 次

概述:使用Aspose.Pdf的OutlineItemCollection,就可以在PDF文件中添加水印。首先需要使用Document对象打开PDF文件。

# 界面/图表报表/文档/IDE等千款热门软控件火热销售中 >>

相关链接:

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

》》》下载Aspose.Pdf试用版

下面的代码片段演示了如何在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")

标签:

本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@ke049m.cn

文章转载自:慧都控件网

为你推荐

  • 推荐视频
  • 推荐活动
  • 推荐产品
  • 推荐文章
  • 慧都慧问
扫码咨询


添加微信 立即咨询

电话咨询

客服热线
023-68661681

TOP
利记足球官网(官方)网站/网页版登录入口/手机版登录入口-最新版(已更新) 真人boyu·博鱼滚球网(官方)网站/网页版登录入口/手机版登录入口-最新版(已更新) 最大网上PM娱乐城盘口(官方)网站/网页版登录入口/手机版登录入口-最新版(已更新) 正规雷火竞技官方买球(官方)网站/网页版登录入口/手机版登录入口-最新版(已更新) 雷火竞技权威十大网(官方)网站/网页版登录入口/手机版登录入口-最新版(已更新) boyu·博鱼信誉足球官网(官方)网站/网页版登录入口/手机版登录入口-最新版(已更新) 权威188BET足球网(官方)网站/网页版登录入口/手机版登录入口-最新版(已更新) 正规188BET足球大全(官方)网站/网页版登录入口/手机版登录入口-最新版(已更新)