Files
python-node-pdf-reader/read_pdf.py

14 lines
285 B
Python

import fitz
import sys
def read_PDF(path):
with fitz.open(path) as doc:
text = ""
for page in doc:
text += page.get_text()
with open(f'recipe_text/{text[:20]}.txt', 'w') as f:
f.write(text)
read_PDF(sys.argv[1])
sys.stdout.flush()