在 PDF 文件中添加或获取附件文件
我们最近有一个客户端能够发送 PDF 文件中的文件(文本文件)。
是否有某种库可以获取或添加 PDF 附件文件?我在网上搜索过,只找到PDF 文件附件< /a>(Adobe 博客文章)。
We have recently got a client that have the ability to send files (text files) inside a PDF file.
Is there some kind of library that can get or add attachment files to PDF? I have searched the web and only found PDF File Attachments (an Adobe blog post).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
iTextSharp 是 Java 库的免费 .NET 端口iText 可以让你做你想做的事。然而,移植库上的文档相当稀缺,您经常需要参考 Java 文档来了解如何做事情和/或谷歌其他人尝试做您需要做的事情。
itextsharp-questions,附加文件中的代码正在做你想要用这个库做的事情。
编辑 25/11/2016
上面的链接已失效,以前有效的代码不再适用于最近的 iTextSharp。请查看iTextSharp for PDF - 如何添加文件附件?获取代码。感谢 @guyl 在评论中指出了这一点。
iTextSharp is a free .NET port of the Java library iText that can let you do what you want. Documentation, however, is rather scarce on the ported library and you will often need to refer to Java documentation to get an idea of how to do things and/or google other peoples' attempts at doing what you need to do.
The code in itextsharp-questions, Attach file is doing exactly what you want to do with this library.
Edit 25/11/2016
The above link is dead and the code that used to work no longer works for recent iTextSharp. Please check iTextSharp for PDF - how add file attachments? for code. Thanks to @guyl for pointing that out in his comment.