find_pdf_slashes.py 588 B

12345678910111213141516171819
  1. import os
  2. import glob
  3. import fitz
  4. docs_dir = r"c:/Users/lanfr144/Documents/DOPRO1/Antigravity/Food/docs"
  5. pdf_files = glob.glob(os.path.join(docs_dir, "*.pdf"))
  6. for pdf_file in pdf_files:
  7. try:
  8. doc = fitz.open(pdf_file)
  9. found = False
  10. for page_idx, page in enumerate(doc):
  11. text = page.get_text()
  12. if "∕" in text:
  13. print(f"Found math slash in {os.path.basename(pdf_file)} on page {page_idx + 1}")
  14. found = True
  15. doc.close()
  16. except Exception as e:
  17. print(f"Error checking {pdf_file}: {e}")