Replace newlines in pdf text with spaces for improved legibility

master
Dan Howe 7 years ago
parent c0680492fe
commit 6d2d7e3a41

@ -79,7 +79,7 @@ def search_pdf(pdf_name, search_patterns, context_length):
page_num = i + 1 page_num = i + 1
page = reader.getPage(i) page = reader.getPage(i)
try: try:
page_text = page.extractText().replace('\n', '') page_text = page.extractText().replace('\n', ' ')
# Skip page if text cannot be read # Skip page if text cannot be read
except (KeyError, ZLibError): except (KeyError, ZLibError):
continue continue

Loading…
Cancel
Save