You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried something like this but exceptions all over
`doc = DocumentFile.from_pdf(pdf_content)
# Perform OCR using doctr
model = ocr_predictor(pretrained=True)
result = model(doc)
# Extract text from the OCR result
text = ""
for page in result.pages:
for block in page.blocks:
for line in block.lines:
for word in line.words:
text += word.value + " "
# Save the OCR result back to the original file path
with open(body.url, 'w') as pdf_file:
pdf_file.write(text)`
Additional context
Thanks for your work.
No response
The text was updated successfully, but these errors were encountered:
馃殌 The feature
I`d like to save the pdf after OCR
Motivation, pitch
Alternatives
I tried something like this but exceptions all over
Additional context
Thanks for your work.
No response
The text was updated successfully, but these errors were encountered: