# pdf2pic **Repository Path**: vinely/pdf2pic ## Basic Information - **Project Name**: pdf2pic - **Description**: 简单的PDF转图片,方便大家。不想要水印,不想用线上工具的可以尝试。 python 3.10编写。 比较小的依赖: dependencies = [ "pymupdf>=1.24.3", "Pillow>=10.1.0", "click>=8.1.7", ] - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-04-23 - **Last Updated**: 2026-04-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # PDF2Pic - PDF to PNG Converter A simple and efficient command-line tool to convert PDF files to PNG images. ## Features - Convert each page of a PDF to individual PNG images - Option to convert only the first page as a single image - Option to combine all pages into one long vertical image - Adjustable DPI for output quality - Customizable output filename prefix - Simple command-line interface - Pure Python, no external system dependencies required ## Requirements - Python 3.8+ **Pure Python implementation**, no external system dependencies required. ## Installation Using uv (recommended): ```bash git clone cd pdf2pic uv venv uv pip install -e . ``` ## Usage ### Command Line Convert all pages of a PDF to PNG: ```bash pdf2pic input.pdf ``` Specify output directory: ```bash pdf2pic input.pdf -o ./output_images ``` Change DPI (default 300): ```bash pdf2pic input.pdf -d 200 ``` Custom filename prefix: ```bash pdf2pic input.pdf -p myimage ``` Convert only first page: ```bash pdf2pic input.pdf -s ``` Combine all pages into one long vertical image: ```bash pdf2pic input.pdf -c ``` Show version: ```bash pdf2pic --version ``` ### Python API ```python from pdf2pic import pdf_to_png # Convert all pages output_files = pdf_to_png( pdf_path="input.pdf", output_dir="./output", dpi=300, prefix="page" ) # Convert only first page output_files = pdf_to_png( pdf_path="input.pdf", single_file=True ) # Combine all pages into one image output_files = pdf_to_png( pdf_path="input.pdf", combine=True ) ``` ## Output - **Default mode**: Each page saved as `page_001.png`, `page_002.png`, etc. - **Single page mode (`-s`)**: Only first page saved as `{pdf_name}.png` - **Combine mode (`-c`)**: All pages combined into one long image `{pdf_name}_combined.png` ## License MIT