generate document metadata