Hay que bajar FPDF, FPDI y FPDF_TPL

Después de eso hay que incluir las librerías en un archivo .php y hay que jugar con los métodos.

Ver un ejemplo:

  include('tcpdf/tcpdf.php');
  include('FPDI/fpdi.php');
 
  class PDF extends FPDI {
    /**
     * "Remembers" the template id of the imported page
     */
    var $_tplIdx;
 
    /**
     * include a background template for every page
     */
    function Header() {}
    function Footer() {}
 
    $num = $this->setSourceFile('archivo.pdf');
 
    for ($i=1; $i< =$num; $i++) {
      $this->AddPage();
 
      $this->_tplIdx = $this->importPage($i);
 
      $this->useTemplate($this->_tplIdx);
      $this->SetMargins(PDF_MARGIN_LEFT, 40, PDF_MARGIN_RIGHT);
      $this->SetAutoPageBreak(true, 40);
 
      $this->setFont("freeserif", "", 12);
      $this-&gt;Write(400, $str);
    }
  }
}
 
// initiate PDF
$pdf = new PDF();
 
$pdf->escribeEnTodos("Marcos es seco");
 
$pdf->Output('archivo_out.pdf', 'D');