poinikos.wordmord-ur.la/parsepdf.py
2022-04-01 11:56:47 +02:00

9 lines
227 B
Python

#!venv/bin python3
import pdftotree
def hocr_result():
hocr_result = pdftotree.parse("static/pdf/downloaded.pdf")
with open('static/hocr/downloaded.hocr', 'w') as f:
f.write(hocr_result)
return hocr_result