Skip to content

Instantly share code, notes, and snippets.

@jansenfelipe
Created April 29, 2014 14:14
Show Gist options
  • Save jansenfelipe/11401643 to your computer and use it in GitHub Desktop.
Save jansenfelipe/11401643 to your computer and use it in GitHub Desktop.
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Welcome extends CI_Controller {
public function index() {
$nome_arquivo = 'teste_'.date('YmdHis');
define('DOMPDF_ENABLE_AUTOLOAD', false);
require_once BASEPATH . '../application/libraries/dompdf/dompdf/dompdf_config.inc.php';
$dompdf = new DOMPDF();
$dompdf->load_html('<strong>Teste Negrito</strong>', 'utf8');
$dompdf->render();
$dompdf->stream($nome_arquivo);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment