actually save generated doc