Asia

mPDF with CodeIgniter

mPDF with CodeIgniter

Tudip

24 June 2016

mPDF is a PHP library which generates PDF files from UTF-8 encoded HTML. It is based on FPDF and HTML2FPDF with a number of enhancements. In the point following you will learn about integration of mPDF with CodeIgniter.

  • Now lets look at the integration of mPDF with CodeIgniter
  • Download mPDF library folder using download link mentioned above.
  • Copy this downloaded folder to third party directory of your CI project.
    application/third_party/mpdf
    
  • Copy mpdf.php which is the library file of the mPDF and paste into libraries folder of the project.
    Copy from : mpdf/mpdf.php and paste inside : application/libraries/
    
  • Load this library in to auto load if you want it to be available everywhere readily.

Now lets write a simple program using mpdf. The following PHP code will produce the most basic example with mPDF.

  • Include the main file containing the mpdf class :
        include('../mpdf.php');
    
  • Create an instance of the class:
        $mpdf = new mPDF();
    
  • Write some HTML code:
        $mpdf->WriteHTML('<p>Hello Tudip Technologies</p>');
    
  • Output a PDF file:
        $mpdf->Output();
        exit;
    

Tudip Technologies

Tudip Technologies is a value-driven Software Services company. We deliver excellence in dedicated and business-centric web solutions incorporated with innovation and expertise as the tools to achieve business goals. Our high-quality, cost-effective, reliable, and scalable services have helped us build an enduring relationship with our clients and customers.

Latest Posts

  • All Posts
  • Casestudy
  • Cloud
  • Healthcare
  • Ios
  • IOT
  • Java
  • Manufacturing
  • News
  • OTT
  • Supply Chain
  • Support and Maintainance
    •   Back
    • Banking
Cloud-Powered Agility

December 27, 2024

27 December 2024 Introduction: Transforming Chaos into Opportunity Imagine a supply chain where disruptions are predicted before they occur, inventory…

Cloud-Powered Agility

December 24, 2024

Imagine a supply chain where disruptions are predicted before they occur, inventory is optimized in real-time, and every stakeholder works…

Related Posts

  • All Posts
  • Healthcare