01.
if
(!defined(
'BASEPATH'
))
02.
exit
(
'No direct script access allowed'
);
03.
04.
include_once
APPPATH .
'/libraries/mpdf/mpdf.php'
;
05.
06.
class
M_pdf {
07.
08.
public
$param
;
09.
public
$pdf
;
10.
public
$mode
=
"th"
;
11.
public
$format
=
"A4"
;
12.
public
$default_font_size
= 0;
13.
public
$default_font
=
""
;
14.
public
$mgl
= 10;
15.
public
$mgr
= 10;
16.
public
$mgt
= 10;
17.
public
$mgb
= 10;
18.
public
$mgh
= 6;
19.
public
$mgf
= 3;
20.
public
$orientation
=
"P"
;
21.
22.
public
function
__construct(
$param
= NULL) {
23.
if
(
is_array
(
$param
)) {
24.
foreach
(
$param
as
$i
=>
$v
) {
25.
if
(property_exists(
'M_pdf'
,
$i
)) {
26.
$this
->{
$i
} =
$v
;
27.
}
28.
}
29.
}
30.
$this
->pdf =
new
mPDF(
$this
->mode,
$this
->format,
$this
->default_font_size,
$this
->default_font,
$this
->mgl,
$this
->mgr,
$this
->mgt,
$this
->mgb,
$this
->mgh,
$this
->mgf,
$this
->orientation);
31.
}
32.
33.
}