1<?php
2
3namespace Mpdf\Tag;
4
5class DotTab extends Tag
6{
7
8	public function open($attr, &$ahtml, &$ihtml)
9	{
10		$objattr = [];
11		$objattr['type'] = 'dottab';
12		$dots = str_repeat('.', 3) . '  '; // minimum number of dots
13		$objattr['width'] = $this->mpdf->GetStringWidth($dots);
14		$objattr['margin_top'] = 0;
15		$objattr['margin_bottom'] = 0;
16		$objattr['margin_left'] = 0;
17		$objattr['margin_right'] = 0;
18		$objattr['height'] = 0;
19		$objattr['colorarray'] = $this->mpdf->colorarray;
20		$objattr['border_top']['w'] = 0;
21		$objattr['border_bottom']['w'] = 0;
22		$objattr['border_left']['w'] = 0;
23		$objattr['border_right']['w'] = 0;
24		$objattr['vertical_align'] = 'BS'; // mPDF 6 DOTTAB
25
26		$properties = $this->cssManager->MergeCSS('INLINE', 'DOTTAB', $attr);
27		if (isset($properties['OUTDENT'])) {
28			$objattr['outdent'] = $this->sizeConverter->convert(
29				$properties['OUTDENT'],
30				$this->mpdf->blk[$this->mpdf->blklvl]['inner_width'],
31				$this->mpdf->FontSize,
32				false
33			);
34		} elseif (isset($attr['OUTDENT'])) {
35			$objattr['outdent'] = $this->sizeConverter->convert(
36				$attr['OUTDENT'],
37				$this->mpdf->blk[$this->mpdf->blklvl]['inner_width'],
38				$this->mpdf->FontSize,
39				false
40			);
41		} else {
42			$objattr['outdent'] = 0;
43		}
44
45		$objattr['fontfamily'] = $this->mpdf->FontFamily;
46		$objattr['fontsize'] = $this->mpdf->FontSizePt;
47
48		$e = "\xbb\xa4\xactype=dottab,objattr=" . serialize($objattr) . "\xbb\xa4\xac";
49		/* -- TABLES -- */
50		// Output it to buffers
51		if ($this->mpdf->tableLevel) {
52			if (!isset($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'])) {
53				$this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'] = $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s'];
54			} elseif ($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'] < $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s']) {
55				$this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'] = $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s'];
56			}
57			$this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s'] = 0; // reset
58			$this->mpdf->_saveCellTextBuffer($e);
59		} else {
60			/* -- END TABLES -- */
61			$this->mpdf->_saveTextBuffer($e);
62		} // *TABLES*
63	}
64
65	public function close(&$ahtml, &$ihtml)
66	{
67	}
68}
69