Error 0: Class 'TCPDF' not found

mvr10

New Member
Hello,
And following with my last thread, I have been working with Fabrik PHP form plugin and TCPDF in order to create a PDF of a form which should upload itself into my web.
PHP:
$pdf->Output('images/hello_{tablename___elementname}.pdf', 'F');
I also used your email plugin to attach this PDF to the email I want to send:
PHP:
;
$file[] = 'images/hello_{tablename___elementname}.pdf';
  return $file;
I don't know what I'm doing wrong, but I always receive an error that says: "Error: 0 Class 'TCPDF' not found":
Error: 0 Class 'TCPDF' not found
/home/mydomain/www/plugins/fabrik_form/php/php.php(537) : eval()'d code:1
I tried reinstalling TCPDF library (without luck).
I will leave you the whole PHP down below, in case you need it. Ah! And I enabled the option "require once" of the PHP form plugin.

Thanks in advance.


PHP:
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
  $pdf->SetCreator(PDF_CREATOR);
  $pdf->SetAuthor('me');
  $pdf->SetTitle('other');
  $pdf->SetSubject('hello');
  $pdf->SetKeywords('hello, world');
  $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 001', PDF_HEADER_STRING, array(0,64,255), array(0,64,128));
  $pdf->setFooterData(array(0,64,0), array(0,64,128));
  $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
  $pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
  $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
  $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
  $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
  $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
  $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
  $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
  $pdf->setFontSubsetting(true);
  $pdf->SetFont('helvetica', '', 12, '', true);
  $pdf->AddPage();
$html = <<<EOD
  <p style="text-align: center;"><span style="font-size: 18pt;"><strong>Title</strong></span></p>
<p style="text-align: center;"><span style="font-size: 18pt;"><strong>Subtitle</strong></span></p>
<p style="text-align: right;"> Date: {mysql_date}</p>
<p> </p>
<p>Some text </p>
EOD;
$pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
$pdf->Output('http://myweb.com/images/autorizacion_{tablename___elementname}.pdf', 'F');
 
Last edited:
We don't use TCPDF, we use either DOMPDF or MPDF, depending which engine you select in the global Fabrik options.

Of course that doesn't stop you using TCPDF, but you're on your own working out how to include it in your code, which will mean either directly requiring their main include file, or adding an autoloader.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top