How can I remove RichMedia annotations?

Question:

I have to remove RichMedia annotations from PDF files, but I find that sometimes they are not removed completely, and there are buttons left behind.

Answer:

Not only do you need to parse all annotations, looking for RichMedia annotations, but you also need search all annotations, in particular Widget annotations that are associated with a Button Field, and check if the annotation has a e_RichMediaExecute Action type, and remove those annotations also.

The AnnotationTest sample project shows how to parse annotations and look for Actions.