check pdf extension and return the right name