Annotations not saving
Posted: Wed Apr 02, 2014 3:54 am
I have pasted the sample code provided into a project and the annotations are not saving onto the pdf:
Code: Select all
' 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)