artwl/pdf2image-laravel

Convert pdf files to images

v2.0.0 2020-04-05 06:57 UTC

This package is auto-updated.

Last update: 2024-10-08 19:17:00 UTC


README

Laravel pdf to image tool

Latest Version on Packagist

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);