PHP code example of sogevia / fpdi

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

    

sogevia / fpdi example snippets



// ...

use \FPDI;
use \FPDF;

// ...
$pdf = new FPDI();

$pageCount = $pdf->setSourceFile("Fantastic-Speaker.pdf");
$tplIdx = $pdf->importPage(1, '/MediaBox');

$pdf->addPage();
$pdf->useTemplate($tplIdx, 10, 10, 90);

$pdf->Output();