Skip to content

Can not create markdownfile from bengali pdf #1185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
amitabha81 opened this issue Apr 12, 2025 · 1 comment
Open

Can not create markdownfile from bengali pdf #1185

amitabha81 opened this issue Apr 12, 2025 · 1 comment

Comments

@amitabha81
Copy link

I have downloaded a book from archive in .pdf format. Write the below code:

#md = MarkItDown(use_azure=False)  # Important: set this flag
md = MarkItDown(use_azure=False, ocr_mode=True)

<!-- Failed to upload "Bharater-Shilpa-sanskritir.pdf" -->

<!-- Failed to upload "Bharater-Shilpa-sanskritir.pdf" -->

file_path = "E:/NLP/Bengali LLM all/DATA/Bharater-Shilpa-sanskritir.pdf"
result = md.convert(file_path)

# Save to .md file
with open("output.md", "w", encoding="utf-8") as f:
    f.write(result.text_content)

print("Markdown saved as output.md")

The output file size is 0 kb.
The input file link is : [(https://archive.org/details/in.ernet.dli.2015.266550/page/n135/mode/2up)]
I have downloaded the pdf version.

@afourney
Copy link
Member

Thanks. Let me take a look.

Markitdown uses PDF miner to extract any existing text or OCR layer. Do you know if this document has one? (I will check).

You can also try the Azure Doc Intelligence integration, which handles PDFs better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants