I am running into an issue when trying to convert a PDF to text where the ligatures 'fi' 'ff' 'fl' are being converted to an empty space. I have read through quite a few similar threads on the issue but have not found a solution that works.
This converted text will then be used to match text within a database. So accuracy is paramount.
Link to PDF
fp = 'Inspection_redacted.pdf'
pdf = pdfplumber.open(fp)
fp = fp[:-3] + 'txt'
text_file = open(fp, "w")
for page in pdf.pages:
text = page.extract_text()
text_file.write(text)
pdf.close()
text_file.close()
Thanks in advance for any tips!




