generate viewdocument