PHP code example of karkowg / php-mupdf

1. Go to this page and download the library: Download karkowg/php-mupdf 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/ */

    

karkowg / php-mupdf example snippets

 bash
$ composer 
 php
$pdf = new Karkow\MuPdf\Pdf('path/to/pdf/file');

$pdf->saveAllPagesAsImages('./images/', 'page-');
 php
$pdf = new Karkow\MuPdf\Pdf('path/to/pdf/file');

$pdf
    ->setPage(2)
    ->setOutputFormat('png')
    ->saveImage('./images/page-2.png');