I am developing a Flutter application where I need to recognize text from images and PDFs and maintain the same format as in the source. I am using google mlkit text recognizer and tesseract ocr for OCR and image_picker
for selecting images. However, I am facing issues in retaining the text format after recognition. The extracted text does not preserve line breaks, spacing, or formatting as in the original document.
Issues:
-
The extracted text does not retain the original format, such as line breaks and spaces.
-
I need the recognized text to appear exactly as it is in the image/PDF.
Questions:
-
How can I modify the code to retain the formatting of the text?
-
Is there a better approach or library for achieving this in Flutter?
Mirnah Indore Team is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.