jjarroyo / laravel-ilovepdf

iLovePDF PHP API for Laravel

Stars
0

Laravel iLovePDF

License
Latest Stable Version
Total Downloads
CircleCI

A Laravel package library for iLovePDF API based on the iLovePDF PHP Library

You can sign up for a iLovePDF account at https://developer.ilovepdf.com

Develop and automate PDF processing tasks like Compress PDF, Merge PDF, Split PDF, convert Office to PDF, PDF to JPG, Images to PDF, add Page Numbers, Rotate PDF, Unlock PDF, stamp a Watermark and Repair PDF. Each one with several settings to get your desired results.

Requirements

PHP 7.2 and later.
Laravel 7.x and later.

Install

Using composer

This package can be used in Laravel 5.5 or higher. You can install the library via Composer. Run the following command:

composer require jjarroyo/laravel-ilovepdf

The service provider and alias will automatically get registered. Or you may manually add them in your config/app.php file:

'providers' => [
    // ...
    JJArroyo\LaravelIlovepdf\LaravelIlovepdfServiceProvider::class,
];

'aliases' => [
    // ...
    'IlovePDF' => JJArroyo\LaravelIlovepdf\Facades\Ilovepdf::class,
];

You can publish the config with:

php artisan vendor:publish --provider="JJArroyo\LaravelIlovepdf\LaravelIlovepdfServiceProvider" --tag="config"

Setup API Keys

Sign up for an iLovePDF account at https://developer.ilovepdf.com to get your Project Key and Secret Key

Add the following in your .env file:

...
ILOVEPDF_PROJECT_KEY=YOUR_PROJECT_KEY
ILOVEPDF_SECRET_KEY=YOUR_SECRET_KEY

Getting Started

Simple usage looks like:

$myTask = ILovePDF::newTask('compress');

$file1 = $myTask->addFile('file1.pdf');

$myTask->execute();

$myTask->setOutputFilename('output.pdf');

$myTask->download();

Documentation

Please see https://developer.ilovepdf.com/docs for up-to-date documentation.

laravel-ilovepdf