You are reading the documentation of the legacy and unsupported version 1 of FPDI.
For version 2 please refer to this documentation.

Examples

Simple

Following example simply imports a single page and displays it at x=10, y=10 and a width of 100 mm. Then it will simply add some more text on top of it:

PHP
<?php
require_once('fpdf/fpdf.php');
require_once('fpdi/fpdi.php');

// initiate FPDI
$pdf = new \FPDI();
// add a page
$pdf->AddPage();
// set the source file
$pdf->setSourceFile("Fantastic-Speaker.pdf");
// import page 1
$tplIdx = $pdf->importPage(1);
// use the imported page and place it at point 10,10 with a width of 100 mm
$pdf->useTemplate($tplIdx, 10, 10, 100);

// now write some text above the imported page
$pdf->SetFont('Helvetica');
$pdf->SetTextColor(255, 0, 0);
$pdf->SetXY(30, 30);
$pdf->Write(0, 'This is just a simple text');

$pdf->Output();

Import a Whole Document

To import a whole document you need to iterate over all existing pages. The page count will be returned by the setSourceFile() method:  

PHP
<?php
require_once('fpdf/fpdf.php');
require_once('fpdi/fpdi.php');

// initiate FPDI
$pdf = new \FPDI();

// get the page count
$pageCount = $pdf->setSourceFile('Laboratory-Report.pdf');
// iterate through all pages
for ($pageNo = 1; $pageNo <= $pageCount; $pageNo++) {
    // import a page
    $templateId = $pdf->importPage($pageNo);
    // get the size of the imported page
    $size = $pdf->getTemplateSize($templateId);

    // create a page (landscape or portrait depending on the imported page size)
    if ($size['w'] > $size['h']) {
        $pdf->AddPage('L', array($size['w'], $size['h']));
    } else {
        $pdf->AddPage('P', array($size['w'], $size['h']));
    }

    // use the imported page
    $pdf->useTemplate($templateId);

    $pdf->SetFont('Helvetica');
    $pdf->SetXY(5, 5);
    $pdf->Write(8, 'A complete document imported with FPDI');
}

// Output the new PDF
$pdf->Output();

Concatenate Several Documents

So concatenating imported pages of different documents is that easy, too:

PHP
<?php
require_once('fpdf/fpdf.php');
require_once('fpdi/fpdi.php');

// define some files to concatenate
$files = array(
    'Boombastic-Box.pdf',
    'Fantastic-Speaker.pdf',
    'Noisy-Tube.pdf'
);

// initiate FPDI
$pdf = new \FPDI();

// iterate through the files
foreach ($files AS $file) {
    // get the page count
    $pageCount = $pdf->setSourceFile($file);
    // iterate through all pages
    for ($pageNo = 1; $pageNo <= $pageCount; $pageNo++) {
        // import a page
        $templateId = $pdf->importPage($pageNo);
        // get the size of the imported page
        $size = $pdf->getTemplateSize($templateId);

        // create a page (landscape or portrait depending on the imported page size)
        if ($size['w'] > $size['h']) {
            $pdf->AddPage('L', array($size['w'], $size['h']));
        } else {
            $pdf->AddPage('P', array($size['w'], $size['h']));
        }

        // use the imported page
        $pdf->useTemplate($templateId);

        $pdf->SetFont('Helvetica');
        $pdf->SetXY(5, 5);
        $pdf->Write(8, 'A simple concatenation demo with FPDI');
    }
}

// Output the new PDF
$pdf->Output();

Letterhead

Following demo shows you how to add a letterhead to every created page in an implemented Header() method: 

PHP
<?php
require_once('fpdf/fpdf.php');
require_once('fpdi/fpdi.php');

// Some dummy functions to generate text content
function GenerateWord()
{
    // Get a random word
    $nb = rand(3, 10);
    $w = '';
    for ($i = 1; $i <= $nb; $i++)
        $w .= chr(rand(ord('a'), ord('z')));
    return $w;
}

function GenerateSentence($words = 500)
{
    // Get a random sentence
    $nb = rand(20, $words);
    $s = '';
    for ($i = 1; $i <= $nb; $i++)
        $s .= GenerateWord() . ' ';
    return substr($s, 0, -1);
}

// The class, that overwrites the Header() method:
class PDF extends \FPDI
{
    protected $_tplIdx;

    public function Header()
    {
        if (null === $this->_tplIdx) {
            $this->setSourceFile('Letterhead.pdf');
            $this->_tplIdx = $this->importPage(1);
        }

        $this->useTemplate($this->_tplIdx);
    }
}

// initiate PDF
$pdf = new \PDF();
$pdf->SetTopMargin(30);

// Add a single page and trigger some auto page breaks.
$pdf->AddPage();
$pdf->SetFont('Helvetica');
for ($i = 20; $i > 0; $i--) {
    $pdf->MultiCell(0, 6, GenerateSentence());
    $pdf->Ln();
}

// Output the new PDF
$pdf->Output();