Create PDF file using Codeigniter with MYSQL

PDF stands for the Portable Document Format. The PDF format is commonly used for saving documents and publications in a standard format that can be viewed on multiple devices. In this tutorial, explains how to generate a pdf file in Codeigniter using TCPDF library.TCPDF is now one of the world’s most active Open Source projects, used daily by millions of users and included in thousands of Web applications.
First, we need to download TCPDF Library, then extract TCPDF Library
Step 1: Extract TCPDF Library
Note: Copy and Paste inside “application/third_party” folder.
Step 2: Create file
Create a file named Pdf.php inside “application/libraries” folder.
Step 3: Create Database
For this tutorial, you need a MySQL database with the following table:
Step 4: Create Controller and load class
Syntax: Load “Pdf” class in controller.
Create a controller file like Createpdf.php inside “application/controllers” folder.
Step 5: Create Model
Create a model file named Createpdf_model.php inside “application/models” folder.
Step 6: Create views
Create a views file named index.php inside “application/views/pdf” folder.
Step 6: Create views
Create a views file named file.php inside “application/views/pdf” folder.