artwl / pdf2image-laravel
Convert pdf files to images
v2.0.0
2020-04-05 06:57 UTC
Requires
- php: >=5.5.0
- ext-imagick: *
- illuminate/support: ~5.2
- intervention/image: ^2.0
README
Laravel pdf to image tool
Dependencies
1、imagick
2、intervention/image": "^2.0"
Install
$ composer require artwl/pdf2image-laravel
Optional(Add Provider And Alias if laravel < 5.5)
Add this to your config/app.php
under "providers":
Artwl\Pdf2Image\Pdf2ImageMaker::class,
under "aliases":
'Pdf2Image'=>Artwl\Pdf2Image\Pdf2ImageFacade::class,
Examples
Get pdf file pages count
use Pdf2Image; $pageCount = Pdf2Image::setFile(public_path() . "/imgs/test.pdf") -> totalPages();
Pdf all page to imgs
use Pdf2Image; $imgs = Pdf2Image::setFile(public_path() . "/imgs/test.pdf") -> saveImages(public_path() . "/imgs/");
Pdf one page to img
use Pdf2Image; $imgs = Pdf2Image::setFile(public_path() . "/imgs/test.pdf") -> saveImages(public_path() . "/imgs/", 0);