1 | <?php |
||
11 | class TcpdfWrapper |
||
12 | { |
||
13 | private $__pdf; |
||
14 | private $__fonts = []; |
||
15 | private $__tcpdfFonts; |
||
16 | |||
17 | /** |
||
18 | * __construct |
||
19 | * |
||
20 | * @author hagiwara |
||
21 | */ |
||
22 | public function __construct() |
||
27 | |||
28 | /** |
||
29 | * setPrintHeader |
||
30 | * |
||
31 | * @param boolean $print 出力フラグ |
||
32 | * @author hagiwara |
||
33 | */ |
||
34 | public function setPrintHeader($print) |
||
38 | |||
39 | /** |
||
40 | * setPrintFooter |
||
41 | * |
||
42 | * @param boolean $print 出力フラグ |
||
43 | * @author hagiwara |
||
44 | */ |
||
45 | public function setPrintFooter($print) |
||
49 | |||
50 | /** |
||
51 | * setFont |
||
52 | * |
||
53 | * @param string $name フォント名 |
||
54 | * @param string $path フォントパス nullでデフォルトセット |
||
55 | * @author hagiwara |
||
56 | */ |
||
57 | public function setFont($name, $path) |
||
61 | |||
62 | /** |
||
63 | * addPage |
||
64 | * |
||
65 | * @param string $template テンプレートパス |
||
66 | * @param integer $templateIndex テンプレートページ |
||
67 | * @author hagiwara |
||
68 | */ |
||
69 | public function addPage($template, $templateIndex) |
||
83 | |||
84 | /** |
||
85 | * setVal |
||
86 | * |
||
87 | * @param string $text テキスト |
||
88 | * @param array $option オプション |
||
89 | * @author hagiwara |
||
90 | */ |
||
91 | public function setVal($text, $option) |
||
129 | |||
130 | /** |
||
131 | * setHtml |
||
132 | * |
||
133 | * @param string $html HTML |
||
134 | * @param array $option オプション |
||
135 | * @author hagiwara |
||
136 | */ |
||
137 | public function setHtml($html, $option) |
||
165 | |||
166 | /** |
||
167 | * getFont |
||
168 | * |
||
169 | * @param string $font フォント名 |
||
170 | * @author hagiwara |
||
171 | */ |
||
172 | private function getFont($font) |
||
180 | |||
181 | /** |
||
182 | * setImage |
||
183 | * |
||
184 | * @param string $image 画像パス |
||
185 | * @param array $option オプション |
||
186 | * @author hagiwara |
||
187 | */ |
||
188 | public function setImage($image, $option) |
||
202 | |||
203 | |||
204 | /** |
||
205 | * colorCodeConvert |
||
206 | * |
||
207 | * @param string $color カラーコード(16進数) |
||
208 | * @author hagiwara |
||
209 | */ |
||
210 | private function colorCodeConvert($color) |
||
228 | |||
229 | /** |
||
230 | * setAutoPageBreak |
||
231 | * page brackeを自動で行うかどうか。画像を下部に埋め込む際には切っておいたほうが良さげ |
||
232 | * @param int $auto |
||
233 | * @param int $margin |
||
234 | */ |
||
235 | public function setAutoPageBreak($auto, $margin = 0) |
||
239 | |||
240 | /** |
||
241 | * getStringWidth |
||
242 | * |
||
243 | * @param string $text テキスト |
||
244 | * @param string $font フォント名 |
||
245 | * @param string $fontstyle フォントスタイル |
||
246 | * @param integer $fontsize サイズ |
||
247 | * @param bool $getarray 結果を1文字ずつ配列で返すか |
||
248 | * @author hagiwara |
||
249 | */ |
||
250 | public function getStringWidth($text, $font, $fontstyle, $fontsize, $getarray = false) { |
||
253 | |||
254 | /** |
||
255 | * write |
||
256 | * |
||
257 | * @param string $file 出力ファイル |
||
258 | * @author hagiwara |
||
259 | */ |
||
260 | public function write($file) |
||
268 | |||
269 | } |
||
270 |
When comparing two booleans, it is generally considered safer to use the strict comparison operator.