Change pdf stream to buffer promise for better error handling