Accurate text extraction from PDFs