Welcome Guest, Not a member yet? Register   Sign In
Class not found trying to integrate TCPDF
#1

(This post was last modified: 09-01-2021, 03:43 PM by SoccerGuy3.)

Following the instructions here: https://forum.codeigniter.com/thread-754...#pid377974

I setup TCPDF, but upon running I am getting an error. As best I can tell I followed the instructions exactly (except for a slight name change). What am I missing?

Unzipped the file downloaded from GitHub into App/ThirdParty/TCPDF

Added a file (SBPdf.php) into App/Libraries:
PHP Code:
<?php

 
namespace App\Libraries;

 use 
App\ThirdParty\TCPDF\Tcpdf;

 class 
SBPdf extends TCPDF {
 } 

Then in my controller I call it:
PHP Code:
public function testpdf()
 {
 
$pdf = new SBPdf(PDF_PAGE_ORIENTATIONPDF_UNITPDF_PAGE_FORMATtrue'UTF-8'false);

etcetc.... 

At that point I was getting an error: 'Class "App\Controllers\Admin\SBPdf" not found'

I then added this to my controller (app/Controllers/Admin/Services.php), which got me closer, I think:
PHP Code:
use App\Libraries\SBPdf

But this produces an error of: 'Class "App\ThirdParty\TCPDF\Tcpdf" not found' error.

Feel like I am missing something obvious as others have said it just works, so... Help!
Reply


Messages In This Thread
Class not found trying to integrate TCPDF - by SoccerGuy3 - 09-01-2021, 03:41 PM



Theme © iAndrew 2016 - Forum software by © MyBB