Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marwan-ahmed-23/pdf-to-images-conversion-php
A lightweight PHP service for converting PDF files into images using pdftoppm. Supports PNG output and generates images for each page in the PDF.
https://github.com/marwan-ahmed-23/pdf-to-images-conversion-php
image-extraction image-processing open-source open-source-php pdf-conversion pdf-to-image pdf-tools php-library php-scripts php-tools
Last synced: 10 days ago
JSON representation
A lightweight PHP service for converting PDF files into images using pdftoppm. Supports PNG output and generates images for each page in the PDF.
- Host: GitHub
- URL: https://github.com/marwan-ahmed-23/pdf-to-images-conversion-php
- Owner: marwan-ahmed-23
- License: mit
- Created: 2024-12-07T06:46:24.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-12-27T05:40:06.000Z (20 days ago)
- Last Synced: 2024-12-27T06:24:32.440Z (20 days ago)
- Topics: image-extraction, image-processing, open-source, open-source-php, pdf-conversion, pdf-to-image, pdf-tools, php-library, php-scripts, php-tools
- Language: PHP
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PDF to Images Conversion (PHP)
A lightweight PHP service for converting PDF files into images using `pdftoppm`. Supports PNG output and generates images for each page in the PDF.
---
## 🚀 Features
- Converts PDF files into images (PNG format).
- Outputs one image per page in the PDF.
- Lightweight and easy to integrate.## ⚙️ Requirements
- PHP 7.4 or higher.
- `pdftoppm` installed on the server (part of `poppler-utils`).## 🔧 Installation
1. Clone the repository:
```bash
git clone https://github.com/marwan-ahmed-23/PDF-to-Images-Conversion-php.git
```
2. Install `pdftoppm` (if not already installed):
```bash
sudo apt install poppler-utils
```## Usage
### Example
Use the provided example script in the `examples/` directory:
```bash
require_once __DIR__ . '/../src/PdfToImages.php';use PdfToImages\PdfToImages;
$pdfPath = __DIR__ . '/sample.pdf';
$outputDir = __DIR__ . '/output';$converter = new PdfToImages($pdfPath, $outputDir);
$images = $converter->convert();print_r($images);
```Place a sample PDF in the `examples/` folder and run the script:
```bash
php examples/example.php
```## 📂 Directory Structure
```plaintext
PDF-to-Images-Conversion-php/
├── examples/
│ └── example.php
├── src/
│ └── PdfToImages.php
├── LICENSE
├── .gitignore
└── README.md
```## 🤝 Contributing
Contributions are welcome! Feel free to submit a pull request or open an issue to report bugs or suggest features.
## 🌟 Show Your Support
If you found this project helpful, please consider giving it a ⭐ on GitHub. Your support means the world to us!