Nearest traficar inforations.

This commit is contained in:
kplaczek
2018-07-04 20:57:28 +02:00
parent db3f7772a6
commit b4aa26ee17
4 changed files with 114 additions and 11 deletions

View File

@@ -28,6 +28,16 @@ class Paper
}
}
public function getConnector()
{
return $this->connector;
}
public function getPrinter()
{
return $this->printer;
}
public function sendHeaderPrint($title)
{
@@ -42,11 +52,15 @@ class Paper
}
}
public function sendImagePrint($image, $imageLocal = true)
public function sendImagePrint($image, $imageLocal = true, $icon = true)
{
if ($image) {
if ($imageLocal) {
$img = EscposImage::load($this->imageDirectory . basename($image) . '.png');
if ($icon) {
$img = EscposImage::load($this->imageDirectory . basename($image) . '.png');
} else {
$img = EscposImage::load($image);
}
} else { //image not local so then remote image
$extension = strtolower(pathinfo($image, PATHINFO_EXTENSION));
@@ -67,7 +81,13 @@ class Paper
$this->sendImagePrint($image, $imageLocal);
$this->sendHeaderPrint($title);
$htmlToPos = new HtmlToPos();
$this->printer->text($htmlToPos->convert($text));
$convertedData = $htmlToPos->convert($text);
if (is_array($convertedData)) {
$this->printer->text($convertedData['text']);
} else {
$this->printer->text($htmlToPos->convert($text));
}
$this->printer->feed(3);
}