1

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).

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
guyl
  • 2,158
  • 4
  • 32
  • 58
  • Ok i have found this post http://stackoverflow.com/questions/3007218/itextsharp-for-pdf-how-add-file-attachments – guyl Jun 07 '11 at 09:23

1 Answers1

6

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.

Community
  • 1
  • 1
Maverik
  • 5,619
  • 35
  • 48
  • @Peter Mortensen: thanks peter, learned from your edits! too bad I can't +1 you for that but you have my appreciation! – Maverik Jun 07 '11 at 11:48