https://github.com/m-ah07/Merge-Images-to-PDF-php
A simple PHP project for merging multiple images into a single PDF file. This project uses the FPDF library to handle PDF generation.
https://github.com/m-ah07/Merge-Images-to-PDF-php
image-processing image-to-pdf merge-images open-source pdf-generation pdf-tools php php-projects
Last synced: 10 months ago
JSON representation
A simple PHP project for merging multiple images into a single PDF file. This project uses the FPDF library to handle PDF generation.
- Host: GitHub
- URL: https://github.com/m-ah07/Merge-Images-to-PDF-php
- Owner: marwan-ahmed-23
- License: mit
- Created: 2024-12-03T10:16:21.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-27T06:10:44.000Z (over 1 year ago)
- Last Synced: 2024-12-27T07:18:48.135Z (over 1 year ago)
- Topics: image-processing, image-to-pdf, merge-images, open-source, pdf-generation, pdf-tools, php, php-projects
- Language: PHP
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Merge Images to PDF (php)
A simple PHP project for merging multiple images into a single PDF file. This project uses the FPDF library to handle PDF generation.
## Features
- Supports multiple image formats (JPEG, PNG, etc.).
- Dynamically adjusts images to fit within the PDF page.
## Requirements
- PHP 7.4 or higher.
- [FPDF library](http://www.fpdf.org/).
## Installation
Clone the repository and install the required dependencies:
```bash
git clone https://github.com/m-ah07/Merge-Images-to-PDF-php.git
cd merge-images-to-pdf
composer install
```
## Usage
Here's an example of how to use the project:
```bash
require_once __DIR__ . '/src/MergeImagesToPdf.php';
use MergeImages\MergeImagesToPdf;
$images = [
'path/to/image1.jpg',
'path/to/image2.jpg',
];
$outputPath = 'output/merged.pdf';
$merger = new MergeImagesToPdf();
$merger->merge($images, $outputPath);
echo "PDF successfully created at: {$outputPath}";
```
## Folder Structure
```plaintext
merge-images-to-pdf/
├── examples/
│ └── example.php
├── src/
│ └── MergeImagesToPdf.php
├── LICENSE
├── .gitignore
└── README.md
```
## Contributing
Contributions are welcome! Please fork this repository, make your changes, and submit a pull request.
## Show Your Support
If you found this project helpful, please consider giving it a ⭐ on GitHub. Your support means the world to us!