首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Aspose.word :将pdf附件添加到word文件

Aspose.word :将pdf附件添加到word文件
EN

Stack Overflow用户
提问于 2016-09-26 13:26:55
回答 3查看 1K关注 0票数 1

我是.Net中的aspose.word新手。

我有一个模板文档,我需要用附件替换word文档中的文本字段。我有excel和pdf文档作为附件。

有一天能帮我在word文档中添加附件吗?

谢谢,乔伊

EN

回答 3

Stack Overflow用户

发布于 2016-09-27 15:58:44

将数据绑定到适当的字段后,将其转换为PDF。然后,您可以将这两个PDF合并在一起。

代码语言:javascript
运行
复制
using (var ms = new MemoryStream())
{
    // save Aspose doc to stream as pdf
    doc.Save(ms, SaveFormat.Pdf);
    ms.Position = 0;

    // append doc
    var pdf = new PdfDocument(ms);
    pdf.Append(doc);
    pdf.Save(fileName);
}
票数 0
EN

Stack Overflow用户

发布于 2016-10-04 23:34:10

我建议您使用Aspose.Words的find and replace功能找到一个文本,并将其替换为图像和OLE对象。可以使用DocumentBuilder.InsertImage将图像插入到文档中,使用DocumentBuilder.InsertOleObject方法将文件中嵌入或链接的OLE对象插入到文档中。请参考下面的文章。

Use DocumentBuilder to Insert Document Elements

我与Aspose一起工作,作为开发人员的布道者。

票数 0
EN

Stack Overflow用户

发布于 2017-11-15 18:59:26

您可以使用InsertOleObject

试试这个:

代码语言:javascript
运行
复制
 doc = new Document();
    DocumentBuilder builder = new DocumentBuilder(doc);
    Stream memStream = File.OpenRead("addreess+file.xls");
    Shape oleObject = builder.InsertOleObject(memStream, "AcroExch.Document.7"", false, null);
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39695233

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档