Adding more logic for process pdf.