<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
require_once ('asset/tcpdf/tcpdf.php');
class MY_tcpdf extends TCPDF {
public function __construct($orientation='P', $unit='mm', $format='A4', $unicode=true, $encoding='UTF-8', $diskcache=false, $pdfa=false){
parent::__construct($orientation, $unit, $format, $unicode, $encoding, $diskcache, $pdfa);
}
}
/* End of file MY_tcpdf.php */
Создала контроллер: pdf.php
class Pdf extends My_Controller {
public function __construct()
{
parent::__construct();
// Russian
$this->l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$this->l['a_meta_charset'] = 'UTF-8';
$this->l['a_meta_dir'] = 'ltr';
$this->l['a_meta_language'] = 'ru';
// TRANSLATIONS --------------------------------------
$this->l['w_page'] = 'страница';
}
//PDF документ Анкета
public function pdf_ank($id)
{
$this->load->library('my_tcpdf');
$l = $this->l;
// create new PDF document
$pdf = new MY_TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Nicola Asuni');
$pdf->SetTitle('TCPDF Example 048');
$pdf->SetSubject('TCPDF Tutorial');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
....
$pdf->writeHTML($tbl, true, false, false, false, '');
// -----------------------------------------------------------------------------
ob_clean();
flush();
//Close and output PDF document
$pdf->Output('example_048.pdf', 'I');
}
}
Выходит ошибка: