Have you saved changes to the document?
What kind of plugin are you writing? If your code is in a DocumentOperation then changes made to the input documents aren't saved by default. Typically the operation is expected to create new documents for the results.
If the only thing you want to do with your plugin is add annotations then you might want to create an AnnotationGenerator instead.