Added direct write to pdf