Reformat document