I am using iTextSharp to create a PDF in C #. I would like to add another file to the PDF. I just have problems trying to do this. The examples here show some annotations, which are apparently attachments.
Here is what I tried:
writer.AddAnnotation(its.pdf.PdfAnnotation.CreateFileAttachment(writer, new iTextSharp.text.Rectangle(100,100,100,100), "File Attachment", its.pdf.PdfFileSpecification.FileExtern(writer, "C:\\test.xml")));
Well, what happens is adding an annotation to the PDF (appears as a small voice voice), which I don't want. test.xml is displayed in the attachment panel in Adobe Reader, but it cannot be read or saved, and its file size is unknown, so it is unlikely to be correctly attached.
Any suggestions?
c # pdf pdf-generation itext itextsharp
Adam s
source share