π« The Pain Point
You need to share a PDF page on Instagram or include it in a presentation. But you canβt embed PDFs directly - you need images.
π Agentic Solution
A PDF to Image Converter with customizable resolution and format options.
Key Features:
- High DPI: Export at 300 DPI for print quality.
- Format Options: PNG (lossless) or JPG (smaller file size).
- Batch Processing: Convert entire folders of PDFs.
βοΈ Phase 1: Commander (Quick Fix)
For quick conversion.
Prompt:
βI have a PDF
document.pdf. Write a Python script using pdf2image to:
- Convert: All pages to PNG images.
- DPI: 200 DPI (adjustable).
- Output: Save as
page_001.png,page_002.png, etc.Print progress (e.g., βConverting page 1/20β). Handle corrupt PDFs gracefully.β
Result: High-quality images of each page.
ποΈ Phase 2: Architect (Permanent Tool)
For Content Creators.
Engineering Prompt:
**Role:** Python Tool Developer
**Task:** Create a "PDF to Image Converter".
**Requirements:**
1. **GUI:**
* Select PDF or folder.
* DPI slider (72-600).
* Format dropdown (PNG, JPG).
* JPG quality slider.
* Page range option.
* Progress bar.
2. **Logic:**
* Use pdf2image (requires Poppler).
* Handle multi-page PDFs.
* Create output folder per PDF.
3. **Deliverables:**
* `pdf_to_img.py`
* `run.bat`, `run.sh`
* `requirements.txt`
π§ Prompt Decoding
- DPI (Dots Per Inch): Higher = better quality but larger files. 72 for web, 300 for print.
- Poppler: A PDF rendering library required by pdf2image. Must be installed separately.
π οΈ Instructions
- Install Poppler (Windows: download binaries, Mac:
brew install poppler). - Install:
pip install pdf2image - Copy Prompt β Run.