Nearest traficar inforations.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user