Break up text to 32 characters length. #50

Merged
krzysiej merged 1 commits from issue-49 into master 2018-07-29 17:13:20 +02:00

View File

@@ -98,6 +98,18 @@ class HtmlToPos
return $data; return $data;
} }
/**
* łamie tekst w miejscu spacji do długości 32 znaki na linię
* @param $posText
* @return string
*/
public function textBreak($posText)
{
$posText = wordwrap($posText, 32);
return $posText;
}
public function convert($html = '') public function convert($html = '')
{ {
$posText = $this->handleNewLine($html); $posText = $this->handleNewLine($html);
@@ -107,8 +119,8 @@ class HtmlToPos
$posText = $this->vocabularyWord($posText); $posText = $this->vocabularyWord($posText);
$posText = $this->traficar($posText); $posText = $this->traficar($posText);
// print_r($posText); $posText = $this->textBreak($posText);
// die();
return $posText; return $posText;
} }
} }