adjusted for handling bad download or pdf->txt conversion