I would like to update text content within a FreeText annotation when I copy the annotation from one PDF document to another, but for some reason the text does not update in the final PDF using the approach shown below. The annotation object updates, but the final result within the PDF does not reflect the updated content for the FreeText annotation type. Strangely, Ink type annotations do get updated with the revised content, as it shows up in the form of a sticky note looking comment overlaid on top of the Ink annotation itself.
Here's a quick snippet of the code I've used (if needed I can add more):
foreach (var anno in annots)
{
var a = anno.GetPdfObject().CopyTo(masterPdfDoc);
PdfAnnotation ano = PdfAnnotation.MakeAnnotation(a);
var contents = ano.GetContents().ToString();
ano.SetContents(new PdfString("COMMENT: " + contents));
//ano.Put(PdfName.Contents, new PdfString("COMMENT: " + contents));
masterDocPage.AddAnnotation(ano);
}
Would greatly appreciate any advice provided. Thanks