Upcomming Workshop
Others Training
Using mPDF with CodeIgniter 3

Today we discus about Mpdf library where codeigniter working this libary. when php 5 to 7 upgrade, this libary are not working. I think this problem some of developer who can allready develop php 5 codeigniter application. we see how to this package install and old application working is vary fine.
Other think is mpdf Library package through we can easily generate the pdf file.
Overview
Step 1: Download and install Codeigniter
Step 2: Download and Install Mpdf Library
Step 3: Configurations of a vendor directory path
Step 4: Create Controller
Step 5: Create View File
Step 1: Download and install Codeigniter
We are going to install Codeigniter 3, first, we will download a fresh Codeigniter 3 version and install it in our system. so you can follow below Link for Download CodeIgniter.
Step 2: Install Mpdf Library
Now, We will Install the Mpdf package Library using the below composer command.
$ composer require mpdf/mpdf
Step 3: Configurations of a vendor directory path
In this step, We will set the vendor directory path in the “application/config/config.php” file. so you can see the below code.
$config['composer_autoload'] = 'vendor/autoload.php';
Step 4: Create Controller
In this step, we will create a Mypdf.php file in the “application/controller” directory and paste the below code in this controller.
defined('BASEPATH') OR exit('No direct script access allowed'); class Mypdf extends CI_Controller { public function index() { $mpdf = new \Mpdf\Mpdf(); $html = $this->load->view('welcome_message',[],true); $mpdf->WriteHTML($html); $mpdf->Output(); // opens in browser //$mpdf->Output('welcome.pdf','D'); // it downloads the file into the user system. } }
Step 5: Create View File
So finally, we can create another file in and pass some data from the database to the “application/views/” directory. but here we are using simple files like “application/views/welcome_message.php”.
application/views/welcome_message.php

20141120_161903

Help Tips
- Using mPDF with CodeIgniter 3
- How to make an infinite hierarchical parent-child relationship query in MySQL
- Web Design Training Center in Uttara
- one.com এ জিপ ফাইল হোস্টিং এর সমাধান।
- ইন্টারনেটে আয় সম্পর্কে ৫টি ভুল ধারনা
- 5 Advanced Tools for Successful Keyword Research
- ওয়েব ডিজাইন এর গুরুত্বপূর্ণ কিছু অনলাইন রিসোর্সে
- ওয়েব ডেভেলপার দের জন্য যে ১০ টুলস সারা জীবন কাজে লাগবে।
- আমি কেন ওয়ার্ড প্রেস শিখবো?
- ইন্টারনেট এ অর্থ উপার্জন ৫টি পদ্ধতি