Extract Document to file