Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions check_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ def search_pdf(pdf_path, search_terms):
text = reader.pages[page_num].extract_text()

for term in search_terms:
if term in text:
if term.lower() in text.lower():
print(f"\nFound '{term}' on page {page_num + 1}")
print("-" * 80)

# Show some context around the match
pos = text.find(term)
pos = text.lower().find(term.lower())
start = max(0, pos - 100)
end = min(len(text), pos + len(term) + 100)

Expand Down