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 = reader.getPage(i)
try:
page_text = page.extractText().replace('\n', '')
page_text = page.extractText().replace('\n', ' ')
# Skip page if text cannot be read
except (KeyError, ZLibError):
continue

Loading…
Cancel
Save