allow documents to be generated from a file rather than random bytes