handle errors when original pdf files are empty or invalid