fix interface for annotation writing to PDF files

also, add a test for this.
Merge pull request #248 from hwhw/fix_kr1052

fix interface for annotation writing to PDF files