永利最大(官方)网站

logo Aspose.PDF使用教程
文档永利最大(官方)网站>>Aspose.PDF使用教程>>Aspose.Pdf使用教程:在PDF文件中添加附件

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


 要在一个PDF文档中添加附件,您需要创建一个要添加的FileSpecification对象和文件的描述。之后就可以使用集合的Add方法将之添加到Document对象的EmbeddedFiles集合中。 这个EmbeddedFiles集合包含添加到PDF文件中的所有附件。

》》》下载Aspose.Pdf试用版

下面的代码片段演示了如何在PDF文件中添加附件:

C#

//open document
Document pdfDocument = new Document("input.pdf");
//setup new file to be added as attachment
FileSpecification fileSpecification = new FileSpecification("test.txt", "Sample text file");
//add attachment to document's attachment collection
pdfDocument.EmbeddedFiles.Add(fileSpecification);
//save new output
pdfDocument.Save("output.pdf");

VB.NET

'open document
Dim pdfDocument As New Document("input.pdf")
'setup new file to be added as attachment
Dim fileSpecification As New FileSpecification("test.txt", "Sample text file")
'add attachment to document's attachment collection
pdfDocument.EmbeddedFiles.Add(fileSpecification)
'save new output
pdfDocument.Save("output.pdf")
扫码咨询


添加微信 立即咨询

电话咨询

客服热线
023-68661681

TOP
PM娱乐城网络现金网站(官方)网站/网页版登录入口/手机版登录入口-最新版(已更新) PM娱乐城最大(官方)网站/网页版登录入口/手机版登录入口-最新版(已更新) 永利外围最新(官方)网站/网页版登录入口/手机版登录入口-最新版(已更新) 网络权威朗驰娱乐大全(官方)网站/网页版登录入口/手机版登录入口-最新版(已更新) 永利真人网上足球(官方)网站/网页版登录入口/手机版登录入口-最新版(已更新) 利记最火十大网(官方)网站/网页版登录入口/手机版登录入口-最新版(已更新) boyu·博鱼权威网络足球(官方)网站/网页版登录入口/手机版登录入口-最新版(已更新) PM娱乐城网上足球(官方)网站/网页版登录入口/手机版登录入口-最新版(已更新)