1. Go to this page and download the library: Download adamroyle/php-xpdf 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/ */
adamroyle / php-xpdf example snippets
$pdfToText = XPDF\PdfToText::create();
$pdfToText = XPDF\PdfToText::create(array(
'pdftotext.binaries' => '/opt/local/xpdf/bin/pdftotext',
'pdftotext.timeout' => 30, // timeout for the underlying process
), $logger);
$pdfToPpm = XPDF\PdfToPpm::create();
$pdfToPpm->setOutputFormat('png');
// optional, set an output resolution
$pdfToPpm->setResolution(300); // default is 150
// alternatively, set the max width/height in pixels. this overrides the resolution setting.
// $pdfToPpm->setMaxDimension(2000);
$images = $pdfToPpm->getImages('document.pdf');
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.