fix interface for annotation writing to PDF files

also, add a test for this.