1. Go to this page and download the library: Download eddturtle/qpdf-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/ */
$qpdf = new \EddTurtle\Qpdf\Pdf();
$qpdf->addPage(__DIR__ . "/files/TestPdfTwoPage.pdf");
$qpdf->split(__DIR__."/output/test-split.pdf");
if (!$result || !empty($qpdf->getError())) {
var_dump($qpdf->getError());
} else {
var_dump('success');
}
// Results in "/output/" containing 'test-split-1.pdf' and 'test-split-2.pdf'
$qpdf = new \EddTurtle\Qpdf\Pdf();
$pdf->addPage(__DIR__ . "/files/TestPdfTwoPage.pdf");
$result = $pdf->rotate(__DIR__ . "/output/rotated.pdf", "+90", "1");
if (!$result || !empty($qpdf->getError())) {
var_dump($qpdf->getError());
} else {
var_dump('success');
}
// Results in "/output/rotated.pdf" having its first page rotated 90° clockwise
$qpdf = new \EddTurtle\Qpdf\Pdf();
$pdf->addPage(__DIR__ . "/files/TestPdfTwoPage.pdf");
$pdf->addPage(__DIR__ . "/files/TestPdf.pdf");
$count = $pdf->getPageCount();
// Results in $count containing a value of 3
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.