public function render($filename, $data)
    {
        $html = Twig::render($filename, $data);

        $dir = sys_get_temp_dir()."/dompdf";

        $options = new Options();
        $options->setIsRemoteEnabled(true);
        $options->setFontDir($this->resolveDirectory($dir."/lib/fonts"));
        $options->setFontCache($this->resolveDirectory($dir."/lib/fonts"));
        //$options->setRootDir($this->resolveDirectory($dir));
        //$options->setChroot($this->resolveDirectory($dir));
        $dompdf = new Dompdf($options);

        $dompdf->loadHtml($html);
        $dompdf->render();

        return $dompdf->output();
    }