<?php
require('fpdf_ex14_Index_createindex_sprog.php');

$pdf=new PDF_Index();
$pdf->SetFont('Arial','',15);

//Page 1
$pdf->AddPage();
$pdf->Bookmark('Section 1');
$pdf->Cell(0,6,'Section 1',0,1);
$pdf->Bookmark('Sous-section 1',1,-1);
$pdf->Cell(0,6,'Sous-section 1');
$pdf->Ln(50);
$pdf->Bookmark('Sous-section 2',1,-1);
$pdf->Cell(0,6,'Sous-section 2');

//Page 2
$pdf->AddPage();
$pdf->Bookmark('Section 2');
$pdf->Cell(0,6,'Section 2',0,1);
$pdf->Bookmark('Sous-section 1',1,-1);
$pdf->Cell(0,6,'Sous-section 1');

//Index
$pdf->AddPage();
$pdf->Bookmark('Index');
$pdf->CreateIndex();
// --- Envoie le document au navigateur (I) ---
// --- en cas de téléchargement, le nom du fichier ---
// --- est  creation_index.pdf ---
//$pdf->Output();
$pdf->Output('creation_index.pdf','I');
?>
