I'm currently using mpdf 6.1 and I'd like to switch to 7. But I can't find a way to install it without composer. Is there a full package that I can download, unzip and test on my localhost?
2) Ensure all needed classes are loaded This means both mPDF classes and dependencies classes. You can do this manually (reload, find the file with missing class, add require call, repeat) or you can use some autoloading library.
make sure both your PHP version in console and in the server environment is supported. Checking phpinfo(); often does not suffice, try inserting var_dump(PHP_VERSION); die; right before your mPDF code to find actual PHP version used with mPDF.
mPDF is a PHP library which generates PDF files from UTF-8 encoded HTML. It is based on FPDF and HTML2FPDF (see CREDITS), with a number of enhancements. mPDF was written by Ian Back and is released under the GNU GPL v2 licence.
well, i've spend few days to search a way, finally i found it, you can download full package mpdf in this site, after download extract files and place on your project and load 'vendor/autoload.php'. in my case i use it with codeigniter, so i make some php file on libraries folder to load it.
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
class M_pdf
{
function __construct()
{
include_once APPPATH.'libraries\vendor\autoload.php';
}
function pdf()
{
$CI = & get_instance();
log_message('Debug', 'mPDF class is loaded.');
}
function load($param=[])
{
return new \Mpdf\Mpdf($param);
}
}
after that i use it on my controller file :
$this->load->library('M_pdf');
$mpdf = $this->m_pdf->load([
'mode' => 'utf-8',
'format' => 'A4'
]);
$mpdf->WriteHTML("Hello World!");
$mpdf->Output();
but i still recommend to use composer as well,
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With