Based on the search results, finding a single, open-source, LLM-supported tool that directly converts scanned documents into standard Word documents (.docx[5]) with flowing paragraphs (without text boxes) exactly like the original formatting is challenging. Most tools focus on OCR, layout analysis, and extracting structured data, often outputting formats like text, Markdown, or structured JSON/XML, rather than a perfectly formatted, flowing-text .docx[5].
However, several open-source tools and libraries, some utilizing LLMs or advanced AI models, can be components of a workflow to achieve this goal, potentially requiring some scripting to assemble the final .docx[5] file.
Here are some relevant open-source options and concepts:
-
Unstructured.io:
- This is a powerful open-source toolkit designed for ingesting and pre-processing various document types (PDFs, Word docs, images, HTML, etc.).
- It partitions documents into meaningful semantic elements like
Title, NarrativeText, ListItem, etc., using layout analysis and OCR (like Tesseract)[3][2]. This focus on semantic structure is key to avoiding text boxes.
- It's designed to work with LLMs, streamlining data processing for them[1][2].
- While it doesn't directly output a flowing-text
.docx[5] perfectly mimicking the original layout, its structured output (a list of semantic elements) provides the necessary information to programmatically construct such a document using a library like python-docx[5]. It supports various input formats including PDF and images[1][3][4].
- The open-source version requires managing dependencies like Tesseract and Poppler yourself[1][2].
-
Docling:
- An open-source toolkit using state-of-the-art AI models for layout analysis (DocLayNet) and table structure recognition (TableFormer).
- It parses documents into a unified, structured representation, which could potentially be used to generate a flowing-text
.docx[5].
- It runs efficiently on commodity hardware and is available as a Python package or CLI tool[5].
- Like Unstructured.io, it focuses on extracting the structure, which is a necessary step before generating the final Word document[5].
-
Nougat (and tools using it like Marker):
- Nougat (Neural Optical Understanding for Academic Documents) is an open-source LLM-based model developed by Meta specifically for parsing academic documents (PDFs) into Markdown (
.mmd) format[6][7][8].
- It aims to preserve text, mathematical equations, and tables without traditional OCR[6][9].
- Marker is another tool that uses Nougat (and Tesseract) in its pipeline to convert PDF, EPUB, and MOBI to Markdown, claiming higher speed and accuracy on many documents[10].
- Limitations: The output is Markdown, not
.docx[5]. Converting Markdown to .docx[5] is possible (e.g., using Pandoc), but might not perfectly preserve all desired formatting nuances. Both Nougat and Marker have non-commercial license restrictions due to underlying model licenses (CC-BY-NC)[10].
-
Tesseract OCR (Combined with Layout Analysis):
- Tesseract is a widely used open-source OCR engine. It can extract text from images and scanned PDFs[14][15].
- However, Tesseract itself primarily outputs plain text, searchable PDFs, or hOCR (HTML-based format with bounding box information)[14][16][17]. It does not natively create complex
.docx[5] files with flowing text.
- To get flowing text, Tesseract's output would need to be combined with sophisticated layout analysis (potentially from models like LayoutLMv3, DiT, or tools like Unstructured.io/Docling) to understand paragraph structure, and then assembled into a
.docx[5] file. Tesseract alone often struggles with complex layouts or scanned documents compared to newer models[9][19].
-
Other Layout Analysis Tools/Libraries:
- deepdoctection: A Python library that orchestrates deep learning models for document layout analysis and OCR, useful for structuring documents into areas like tables or lists. Could be part of a custom pipeline.
- LayoutLMv3 / DiT: State-of-the-art models for document layout analysis, often used within frameworks like deepdoctection or by tools like Docling[18][5]. These identify the structure (text segments, tables, etc.)[18].
Why Avoiding Text Boxes is Hard:
Converting a scanned document (an image) into a flowing-text Word document requires more than just recognizing characters (OCR). It needs accurate Document Layout Analysis to understand the semantic structure – which blocks of text form a paragraph, which are headings, lists, captions, etc[22][18].. Simply placing recognized text into its original XY coordinates on the page often results in text boxes, which preserves visual fidelity but breaks text flow[23]. Achieving flowing text requires interpreting the layout and reconstructing it sequentially[23][24].
Conclusion:
There isn't a readily available, single open-source LLM tool that perfectly achieves your specific goal out-of-the-box. However, you can likely build a solution using open-source components:
- Use a powerful document parsing toolkit like Unstructured.io[1][3][2] or Docling[5] to process the scanned PDF. These tools leverage AI/LLMs for layout analysis to break the document into semantic elements (paragraphs, titles, lists, etc.).
- Write a script (e.g., in Python) to take the structured output from these tools.
- Use a library like
python-docx[5] to programmatically create a new Word document, adding the extracted elements (like NarrativeText from Unstructured.io) in sequence as standard paragraphs, headings, etc.
This approach prioritizes the semantic structure needed for flowing text over replicating the exact visual positioning, which aligns with your goal of avoiding text boxes. Tools like Unstructured.io are particularly promising as they are designed for pre-processing documents for LLM workflows and focus on extracting these semantic units[1][2].