Skip to content

CodeIgniter helper for export custom PDFs created in realtime.

Notifications You must be signed in to change notification settings

alemohamad/ci-mpdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

CodeIgniter Helper: PDF Export

ci-mpdf

About this library

This CodeIgniter's Helper is used to create a PDF in real time and then export it to download it.
It uses the MPDF Library, which is also in this repository.

Its usage is recommended for CodeIgniter 2 or greater.

Usage

$this->load->helper('pdfexport');

$data['title'] = "Annual Report"; // it can be any variable with content that the code will use

$fileName = date('YmdHis') . "_report";
$pdfView  = $this->load->view('pdf/pdf_template', $data, TRUE); // we need to use a view as PDF content
$cssView  = $this->load->view('pdf/pdf_template_css', NULL, TRUE); // the use a css stylesheet is optional

exportMeAsMPDF($fileName, $pdfView, $cssView, 'P'); // then define the content and filename

Ale Mohamad

About

CodeIgniter helper for export custom PDFs created in realtime.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published