' create image collection
Dim images As New ImageCollection()
' create annotation controller associated with image collection
Dim annotations As New AnnotationDataController(images)
' load PDF file into collection
images.Add("G:\Projects_Sample\_Samples\_1TESTDOCUMENT.pdf")
' get the annotation collection for selected image
Dim imageAnnotations As AnnotationDataCollection = annotations(images.Count - 1)
' create new annotation
Dim anno As New RectangleAnnotationData()
anno.Size = New SizeF(300, 300)
anno.FillBrush = New AnnotationSolidBrush(Color.AliceBlue)
anno.Location = New PointF(0, 0)
' add new annotation into annotation collection
imageAnnotations.Add(anno)
Dim encoder As New PdfEncoder()
' specify that annotations must be saved with image collection
encoder.AnnotationsFormat = AnnotationsFormat.VintasoftBinary
' save image collection synchronously to new file
images.SaveSync("G:\Projects_Sample\_Samples\_1TEST." & Format(Now(), "yyyyMMddhhmmss") & ".pdf", encoder)
I believe the issue is that even though the annotation is added, it is not being displayed when the PDF is opened in Adobe Reader. Can I send you the PDF before and after?
Thank you for PDF document. Your PDF document contains rectangle annotation without PDF annotation appearance, such document could be generated only if you disabled generation of PDF annotation appearance. Unfortunately, we cannot reproduce the issue using your code. Please send us (to support@vintasoft.com) a small working project which demonstrates the issue.
Your project has references to the following DLLs:
Vintasoft.Imaging.dll - allows to work with images
Vintasoft.Annotation.dll - allows to annotate images and save annotations as VintaSoft binary, VintaSoft XMP or WANG packet
Vintasoft.PDF.dll - allows to read/write PDF documents
You also need add reference to Vintasoft.Annotation.Pdf.dll, this assembly allows to generate PDF annotation appearance and the assembly is necessary if you want to view saved annotations in Adobe PDF Reader.