PHP code example of ilovepdf / ilovepdf-php

1. Go to this page and download the library: Download ilovepdf/ilovepdf-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ilovepdf / ilovepdf-php example snippets




use Ilovepdf\Ilovepdf;

$ilovepdf = new Ilovepdf('project_public_id','project_secret_key');
$myTask = $ilovepdf->newTask('compress');
$file1 = $myTask->addFile('file1.pdf');
$myTask->execute();
$myTask->download();
bash
composer