rmenjivar:When I run the “GetAllAnnotationsFromPage” example, it finds the attachment link. But I don’t know where to go from there.
Document doc = new Document(dataDir + “input.pdf”);
foreach (Annotation annotation in doc.Pages.Annotations)
if (annotation.AnnotationType == AnnotationType.FileAttachment)
FileAttachmentAnnotation annot = (FileAttachmentAnnotation)annotation;
byte fileContent = new byte[annot.File.Contents.Length];
FileStream fileStream = new FileStream(dataDir + annot.File.Name + "_out" + ".txt",
fileStream.Write(fileContent, 0, fileContent.Length);
Please check in the above code that I have extracted content of the file from attachment and then save it to the disk using FileStream object. Please try using above approach to get the attachment from your document. In case if you still face any issue please share your input document so that we can test the scenario in our environment and share information accordingly.
Thanks again Asad, this worked!