{"id":24792728,"url":"https://github.com/misaghmomenib/pdf2picture-python","last_synced_at":"2026-04-29T00:01:36.947Z","repository":{"id":259695900,"uuid":"879224331","full_name":"MisaghMomeniB/PDF2Picture-Python","owner":"MisaghMomeniB","description":"A Lightweight Python Tool to Seamlessly Convert Pdf Documents Into High-quality Images. Ideal for Developers Needing Fast and Efficient Pdf-to-image Transformation for Various Use Cases Such as Previews, Archiving, or Content Extraction.","archived":false,"fork":false,"pushed_at":"2025-02-10T15:10:19.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-07T22:41:01.220Z","etag":null,"topics":["converter","git","open-source","pdf-converter","picture-converter","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MisaghMomeniB.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":"2024-10-27T10:52:04.000Z","updated_at":"2025-02-10T15:10:23.000Z","dependencies_parsed_at":"2024-10-27T12:17:47.994Z","dependency_job_id":"4c6607d0-387b-4e36-bdb8-e0a77ddb8a3c","html_url":"https://github.com/MisaghMomeniB/PDF2Picture-Python","commit_stats":null,"previous_names":["misaghmomenib/pdf2picture-python"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MisaghMomeniB/PDF2Picture-Python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MisaghMomeniB%2FPDF2Picture-Python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MisaghMomeniB%2FPDF2Picture-Python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MisaghMomeniB%2FPDF2Picture-Python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MisaghMomeniB%2FPDF2Picture-Python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MisaghMomeniB","download_url":"https://codeload.github.com/MisaghMomeniB/PDF2Picture-Python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MisaghMomeniB%2FPDF2Picture-Python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32404340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T19:38:08.556Z","status":"ssl_error","status_checked_at":"2026-04-28T19:37:55.688Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["converter","git","open-source","pdf-converter","picture-converter","python"],"created_at":"2025-01-29T20:54:40.771Z","updated_at":"2026-04-29T00:01:36.942Z","avatar_url":"https://github.com/MisaghMomeniB.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🖼️ PDF2Picture (Python)\n\nA lightweight Python tool to **convert PDF documents into images** (per‑page JPG or PNG). Ideal for document previews, thumbnail generation, or embedding pages as images in web and mobile apps.\n\n---\n\n## 📋 Table of Contents\n\n1. [Overview](#overview)  \n2. [Features](#features)  \n3. [Prerequisites](#prerequisites)  \n4. [Installation](#installation)  \n5. [Usage](#usage)  \n6. [Code Structure](#code-structure)  \n7. [Implementation Details](#implementation-details)  \n8. [Enhancement Ideas](#enhancement-ideas)  \n9. [Contributing](#contributing)  \n10. [License](#license)\n\n---\n\n## 💡 Overview\n\nPDF2Picture converts each page of a PDF into high-quality image files. It uses libraries like **pdf2image** or **PyMuPDF** to render pages and supports batch conversions, DPI control, and format options (JPG/PNG).\n\n---\n\n## ✅ Features\n\n- 📄 Convert all pages in a PDF to image(s)\n- ⚙️ Configure DPI (e.g., 150–300) for resolution control  \n- 🗂️ Supports output formats `.jpg` and `.png`  \n- 🔁 Batch process multiple PDFs in a folder  \n- 🧰 Easy CLI and importable library interface\n\n---\n\n## 🛠️ Prerequisites\n\n- Python **3.7+**  \n- System dependency: **Poppler** tools (e.g., `pdftoppm`) installed and available in `PATH`  \n- Python libraries:\n\n```bash\npip install pdf2image\n````\n\nOr for enhanced rendering using PyMuPDF:\n\n```bash\npip install PyMuPDF\n```\n\n---\n\n## ⚙️ Installation\n\n```bash\ngit clone https://github.com/MisaghMomeniB/PDF2Picture-Python.git\ncd PDF2Picture-Python\npip install -r requirements.txt  # includes pdf2image\n```\n\nEnsure `pdftoppm` is set up on your system.\n\n---\n\n## 🚀 Usage\n\n### CLI Example\n\nConvert a PDF to PNG images at 200 DPI:\n\n```bash\npython pdf2picture.py \\\n  --input doc.pdf \\\n  --output-dir pages/ \\\n  --dpi 200 \\\n  --format png\n```\n\nThis produces:\n\n* `pages/doc_page_1.png`\n* `pages/doc_page_2.png`\n* …\n\n### Python Module\n\n```python\nfrom pdf2picture import convert_pdf_to_images\n\nimages = convert_pdf_to_images(\n    pdf_path=\"doc.pdf\",\n    output_dir=\"out/\",\n    dpi=150,\n    fmt=\"jpg\"\n)\nprint(f\"Converted {len(images)} pages\")\n```\n\n---\n\n## 📁 Code Structure\n\n```\nPDF2Picture-Python/\n├── pdf2picture.py         # CLI interface \u0026 wrapper logic\n├── pdf2picture_lib.py     # Core conversion functions\n├── requirements.txt\n└── README.md              # This file\n```\n\n* `convert_pdf_to_images(...)`: handles conversion and returns file paths\n* CLI parses options via `argparse` and calls conversion logic\n\n---\n\n## 🔍 Implementation Details\n\n* Uses `pdf2image.convert_from_path(...)` with DPI and format options\n* Creates output directory if missing and saves images with page index\n* Handles errors for invalid PDFs and missing Poppler tools\n\n---\n\n## 💡 Enhancement Ideas\n\n* ✅ Add **PDF page range** selection (e.g., pages 1–5)\n* 🗜️ Support **image compression** or resizing\n* ☁️ Integrate with **web frameworks** (Flask/FastAPI) for upload/download\n* 📦 Export images to **PDF or thumbnails** in a ZIP\n* 🧪 Add **unit tests** and error-handling improvements\n\n---\n\n## 🤝 Contributing\n\nContributions are welcome!\n\n1. Fork the repository\n2. Create a `feature/...` branch\n3. Add clean, documented code\n4. Open a Pull Request\n\n---\n\n## 📄 License\n\nReleased under the **MIT License** — see `LICENSE` for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmisaghmomenib%2Fpdf2picture-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmisaghmomenib%2Fpdf2picture-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmisaghmomenib%2Fpdf2picture-python/lists"}