-
Notifications
You must be signed in to change notification settings - Fork 0
/
TCPDFLabel.php
45 lines (39 loc) · 1.08 KB
/
TCPDFLabel.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
* TCPDFLabel
*
* @link https://github.com/WeeSee/yii2-pdflabel
* @copyright Copyright (c) 2018 WeeSee
* @license https://github.com/WeeSee/yii2-pdflabel/blob/master/LICENSE
*/
namespace weesee\pdflabel;
use Uskur\PdfLabel\PdfLabel as BasePdfLabel;
/**
* This is a proxy class for Uskur\PdfLabel\PdfLabel.
* It is used to directly access TCPDF for setting borders.
*
* @author WeeSee <[email protected]>
*/
class TCPDFLabel extends BasePdfLabel
{
/**
* add one Label using HTML format
* @param string $html
* @param bool $border
*/
public function addExtendedHtmlLabel($html,$border=false)
{
list ($width, $height) = $this->newLabelPosition();
$this->writeHTMLCell($width, $height, null, null, $html, $border, 0, false);
}
/**
* add one Label using plain text format
* @param string $text
* @param bool $border
*/
public function addExtendedLabel($text,$border=false)
{
list ($width, $height) = $this->newLabelPosition();
$this->MultiCell($width, $height, $text, $border, 'L');
}
}