<?php
require_once __DIR__ . '/vendor/autoload.php';

// içerik bölümü cacheleniyor
ob_start();
include ('./html/sablon.php');
$content = ob_get_contents();
ob_end_clean();

$defaultConfig = (new Mpdf\Config\ConfigVariables())->getDefaults();
$fontDirs = $defaultConfig['fontDir'];

$defaultFontConfig = (new Mpdf\Config\FontVariables())->getDefaults();
$fontData = $defaultFontConfig['fontdata'];

$mpdfConfig = array(
    'mode' => 'utf-8',
    'format' => 'A4',
    'margin_header' => '0',
    'margin_top' => 10,
    'margin_footer' => 10,
    'margin_bottom' => 10,
    'margin_left' => 10,
    'margin_right' => 10,
    'orientation' => 'P',
    'tempDir' => 'tmp',
    'fontDir' => array_merge($fontDirs, [
        __DIR__ . '/html/font',
    ]),
    'default_font' => 'frutiger'
);
$mpdf = new \Mpdf\Mpdf(
   $mpdfConfig
);
$mpdf->showImageErrors = true;
$mpdf->WriteHTML($content);
$mpdf->SetDisplayMode('fullpage');

$mpdf->Output();
