{"id":25448872,"url":"https://github.com/kadiryazadzhi/documentconverter","last_synced_at":"2026-05-14T12:37:49.631Z","repository":{"id":277957370,"uuid":"934042853","full_name":"KadirYazadzhi/DocumentConverter","owner":"KadirYazadzhi","description":"📝 The Document Converter is a robust console-based tool that effortlessly extracts text and images from multiple document formats, transforming them into well-structured Markdown (.md) files. 🔄📄","archived":false,"fork":false,"pushed_at":"2025-02-17T21:08:45.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-16T08:09:26.951Z","etag":null,"topics":["csharp","document","education","markdown"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KadirYazadzhi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-17T07:14:51.000Z","updated_at":"2025-02-17T21:08:48.000Z","dependencies_parsed_at":"2025-02-17T08:26:06.537Z","dependency_job_id":"d73727a7-f1af-427d-bf91-830d0a9a4575","html_url":"https://github.com/KadirYazadzhi/DocumentConverter","commit_stats":null,"previous_names":["kadiryazadzhi/documentconverter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KadirYazadzhi%2FDocumentConverter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KadirYazadzhi%2FDocumentConverter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KadirYazadzhi%2FDocumentConverter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KadirYazadzhi%2FDocumentConverter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KadirYazadzhi","download_url":"https://codeload.github.com/KadirYazadzhi/DocumentConverter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254493384,"owners_count":22080127,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","document","education","markdown"],"created_at":"2025-02-17T20:15:26.335Z","updated_at":"2026-05-14T12:37:49.464Z","avatar_url":"https://github.com/KadirYazadzhi.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📜 Document Converter\n\n## 🚀 Overview\nThe **Document Converter** is a powerful console-based tool designed to **extract text and images** from various document formats and convert them into **Markdown** (.md) files. This tool supports multiple formats, including:\n\n✅ **PDF** 📄\n✅ **Word Documents** (.docx, .odt, .rtf) 📝\n✅ **Plain Text** (.txt) 📃\n✅ **HTML** (.html) 🌐\n\nThe extracted content is neatly formatted, making it easy to use for documentation, note-taking, and further processing.\n\n\n## 🛠 Features\n- 🔍 **Automatic document detection** – Reads the file extension and processes accordingly.\n- 🖼 **Extracts images** – Saves images from PDF and Word documents.\n- 🏷 **Preserves formatting** – Headings, lists, bold/italic text are retained.\n- 📂 **Creates an 'Extracted' folder** – Stores output markdown and images.\n- ⚡ **Handles errors gracefully** – Logs errors to `error.log` for debugging.\n- 🎨 **Stylish console banner** – Adds a nice touch to the CLI experience.\n\n\n## 📥 Installation \u0026 Requirements\n### 🖥 Prerequisites\nEnsure you have the following installed:\n- **.NET Framework / .NET Core**\n- **Aspose.Words** (for Word document parsing)\n- **UglyToad.PdfPig** (for PDF extraction)\n\nTo install dependencies:\n```sh\n# Install Aspose.Words (NuGet package)\ndotnet add package Aspose.Words\n\n# Install UglyToad.PdfPig (NuGet package)\ndotnet add package UglyToad.PdfPig\n```\n\n## 🎬 How to Use\n1️⃣ **Run the application**\n```sh\ndotnet run\n```\n\n2️⃣ **Enter the file path** when prompted.\n3️⃣ The program automatically detects the format and extracts the content.\n4️⃣ The extracted **Markdown file** and **images** are saved in the `Extracted/` directory.\n\n\n## 📂 Output Structure\n```\n📂 Extracted/\n ├── 📜 extracted_document.md  # Markdown file with extracted text\n ├── 🖼 image1.png              # Extracted images (if any)\n ├── 🖼 image2.jpg              # Additional images\n```\n\n\n## 🧩 Supported Formats \u0026 Extraction Logic\n### 📝 **Word Documents (.docx, .odt, .rtf)**\n- ✅ Extracts **headings**, **bold**, **italic**, and **underline** formatting.\n- ✅ Retains **lists** and **quotes**.\n- ✅ Extracts **tables** and converts them into Markdown.\n- ✅ Saves **images** inside the `Extracted/` folder.\n\n### 📄 **PDF Files (.pdf)**\n- ✅ Extracts **text page by page**.\n- ✅ Saves **images** from the PDF into `Extracted/`.\n\n### 📃 **Plain Text (.txt)**\n- ✅ Copies text **as-is** into a Markdown file.\n\n### 🌐 **HTML Files (.html)**\n- ✅ Converts HTML content into Markdown-friendly format.\n\n\n## 🏗 Code Breakdown\n### 🔄 **Main Execution Flow**\nThe program follows this simple **looped workflow**:\n1. **Display Banner** 🎨 – Shows a stylized title screen.\n2. **Prompt for File Path** 📂 – Requests user input.\n3. **Detect File Type** 🔍 – Determines the format based on the extension.\n4. **Extract Content** 📜 – Calls the appropriate extraction function.\n5. **Save Output** 💾 – Stores results in `Extracted/`.\n6. **Handle Errors** ❌ – Logs issues in `error.log`.\n\n### 🔑 **Key Functions**\n| Function | Description |\n|----------|-------------|\n| `PrintBanner()` | Displays the ASCII banner. |\n| `ReadFilePath()` | Prompts user to enter a file path and validates it. |\n| `StartLogic(filePath)` | Determines file type and calls appropriate extraction function. |\n| `ExtractFromPdf(filePath, markdownPath, outputDir)` | Extracts text and images from PDF. |\n| `ExtractFromWord(filePath, markdownPath, outputDir)` | Extracts formatted text, tables, and images from Word documents. |\n| `ExtractFromTxt(filePath, markdownPath)` | Converts plain text into Markdown. |\n| `ExtractFromHtml(filePath, markdownPath)` | Extracts HTML content into Markdown. |\n\n\n## ⚠️ Error Handling\nIf an error occurs during execution:\n- The error details (message + stack trace) are logged to `error.log`.\n- A ❌ message is displayed on the console.\n- The program continues running without crashing.\n\n\n## 📌 Future Improvements\n🔹 Add support for **Excel (.xlsx, .csv)** conversion 📊  \n🔹 Improve **image recognition** and metadata extraction 🖼  \n🔹 Implement **batch processing** for multiple files 📁  \n\n\n## 🤝 Contributing\nWant to improve this tool? Feel free to fork, modify, and submit a pull request!\n\n```sh\ngit clone https://github.com/KadirYazadzhi/document-converter.git\ncd document-converter\ndotnet run\n```\n\n\n## 📜 License\nThis project is licensed under the **MIT License** - see the LICENSE file for details.\n\n### ⚖️ What does this mean?\n- ✅ You are free to use, modify, and distribute this software.\n- ✅ You can use it for both personal and commercial projects.\n- ❌ You cannot hold the author liable for any damages or misuse.\n  \n---\n\n🌟 If you like this project, consider giving it a star! ⭐\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkadiryazadzhi%2Fdocumentconverter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkadiryazadzhi%2Fdocumentconverter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkadiryazadzhi%2Fdocumentconverter/lists"}