add getDocument() function
Merge pull request #3031 from henryzhao81/develop

add getDocument() function