|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* To change this license header, choose License Headers in Project Properties. |
|
5
|
|
|
* To change this template file, choose Tools | Templates |
|
6
|
|
|
* and open the template in the editor. |
|
7
|
|
|
*/ |
|
8
|
|
|
|
|
9
|
|
|
/** |
|
10
|
|
|
* Description of df |
|
11
|
|
|
* |
|
12
|
|
|
* @author nadir |
|
13
|
|
|
*/ |
|
14
|
|
|
|
|
15
|
|
|
|
|
16
|
|
|
namespace UGA\Html2PDFBundle\Factory ; |
|
17
|
|
|
|
|
18
|
|
|
class Html2pdfFactory |
|
19
|
|
|
{ |
|
20
|
|
|
private $html2_pdf_orientation; |
|
21
|
|
|
private $html2_pdf_format; |
|
22
|
|
|
private $html2_pdf_lang; |
|
23
|
|
|
private $html2_pdf_unicode; |
|
24
|
|
|
private $html2_pdf_encoding; |
|
25
|
|
|
private $html2_pdf_margin; |
|
26
|
|
|
/** |
|
27
|
|
|
* @param string $orientation |
|
28
|
|
|
* @param string $format |
|
29
|
|
|
* @param string $lang |
|
30
|
|
|
* @param boolean $unicode |
|
31
|
|
|
* @param string $encoding |
|
32
|
|
|
* @param int[] $margin |
|
33
|
|
|
*/ |
|
34
|
|
|
public function __construct($orientation, $format, $lang, $unicode, $encoding, $margin) |
|
35
|
|
|
{ |
|
36
|
|
|
$this->html2_pdf_orientation = $orientation; |
|
37
|
|
|
$this->html2_pdf_format = $format; |
|
38
|
|
|
$this->html2_pdf_lang = $lang; |
|
39
|
|
|
$this->html2_pdf_unicode = $unicode; |
|
40
|
|
|
$this->html2_pdf_margin = $margin; |
|
41
|
|
|
$this->html2_pdf_encoding = $encoding; |
|
42
|
|
|
} |
|
43
|
|
|
|
|
44
|
|
|
|
|
45
|
|
|
public function getInstance($orientation = null, $format = null, $lang = null, $unicode = null, $encoding = null, $margin = null) |
|
46
|
|
|
|
|
47
|
|
|
{ |
|
48
|
|
|
return new \HTML2PDF( |
|
49
|
|
|
$orientation ? $orientation : $this->html2_pdf_orientation , |
|
50
|
|
|
$format ? $format : $this->html2_pdf_format, |
|
51
|
|
|
$lang ? $lang : $this->html2_pdf_lang, |
|
52
|
|
|
$unicode ? $unicode : $this->html2_pdf_unicode, |
|
53
|
|
|
$margin ? $margin : $this->html2_pdf_margin , |
|
54
|
|
|
$encoding ? $encoding : $this->html2_pdf_encoding |
|
55
|
|
|
|
|
56
|
|
|
); |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
|
} |