add annotations based on the existing annotation on the page
Dear Adobe,
I want to add annotations based on the existing annotation on the page, and I want to inherit the appearance of that annotation to add the new one. Here is my code for doing this. I try to use the function PDAnnotFromCosObj to get the CosObj of the existing annotation "annot", but I tried and nothing happened, could you please tell me is it a good way to copy the existing annotation's property to creating a new annotation? Do I need to use PDPageCreateAnnot to create a new one? My existing annotation "annot" is valid and created by using cosobj dict to set the appearance by another program.
CosObj cosAnnot = PDAnnotGetCosObj(annot);
CosDoc cosDoc = CosObjGetDoc(cosAnnot);
PDAnnot Newannot = PDAnnotFromCosObj(cosAnnot);
ASText titleText = ASTextNew();
sprintf(setbuf, "Fang");
ASTextSetPDText(titleText, setbuf);
PDTextAnnotSetContentsASText(Newannot, titleText);
PDPageAddAnnot(page, -2, Newannot);
Best Regards/Bien Cordialement
Alex Fang
