pdf-to-image-python / README.md
algorembrant's picture
Upload 10 files
1d50b6b verified
# PDF to Image (Python)
[![License](https://img.shields.io/github/license/not-algorembrant/pdf-to-image-python)](https://github.com/not-algorembrant/pdf-to-image-python)
[![Repo Size](https://img.shields.io/github/repo-size/not-algorembrant/pdf-to-image-python)](https://github.com/not-algorembrant/pdf-to-image-python)
[![Last Commit](https://img.shields.io/github/last-commit/not-algorembrant/pdf-to-image-python)](https://github.com/not-algorembrant/pdf-to-image-python)
[![Python](https://img.shields.io/badge/python-3.14+-blue.svg)](https://www.python.org/)
[![Markdown](https://img.shields.io/badge/markdown-%23000000.svg?style=flat&logo=markdown&logoColor=white)](https://en.wikipedia.org/wiki/Markdown)
Simply convert PDF files into rendered image pages at high resolution.
This project was inspired by and serves as a Python alternative to the PHP package [spatie/pdf-to-image](https://github.com/spatie/pdf-to-image).
## System Overview
```mermaid
graph TD
A[PDF Input] --> B{Process Type}
B -->|Single| C[single_page.py]
B -->|Batch| D[all_page.py]
C --> E[First Page Export]
D --> F[Full Document Export]
E --> G[Output Folder]
F --> G
```
## Project Structure
```text
pdf-to-image-python/
β”œβ”€β”€ .gitignore # Git ignore rules
β”œβ”€β”€ PDF/ # Input PDF directory
β”œβ”€β”€ output/ # Generated images directory (auto-created)
β”œβ”€β”€ LICENSE # Project license
β”œβ”€β”€ README.md # Main documentation
β”œβ”€β”€ STACKS.md # Technical stack audit
β”œβ”€β”€ all_page.py # Full PDF conversion script
β”œβ”€β”€ requirements.txt # Dependency list
└── single_page.py # First page conversion script
```
## Requirements
- Python 3.14+
- PyMuPDF library
## Setup Instructions
Make sure your environment is ready before running the tool:
1. Create a virtual environment:
```bash
python -m venv venv
```
2. Activate the virtual environment:
```bash
# On Windows
venv\Scripts\activate
```
3. Install the dependencies:
```bash
pip install -r requirements.txt
```
## Usage
Basic usage to convert a PDF in the most efficient way:
```bash
# Convert all pages of a PDF (provide folder or file)
python all_page.py "PDF_folder" --dpi 300 --format png
# Convert only the first page (Cover) for quick previews
python single_page.py "PDF_folder" --dpi 300 --format png
```
## Citation
If you use this tool in your research or project, please cite it as follows:
```bibtex
@misc{pdf_to_image_2026,
author = {Rembrant Oyangoren Albeos},
title = {PDF to Image Python Utility},
year = {2026},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/not-algorembrant/*}},
}
```