#!/usr/bin/php

<?php

require('fpdf.php');

$tmpDir = getenv('AUTOPKGTEST_TMP');

$pdfPath = $tmpDir . '/file.pdf';

$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output('F', $pdfPath);

echo "PDF created.\n";

if (file_exists($pdfPath)){
    echo "File exist in: $pdfPath\n";
    exit(0);
} else {
    echo "File doesn't exist";
    exit(1);
}

?>
