mirror of
https://github.com/hotspotbilling/phpnuxbill.git
synced 2025-08-04 02:04:53 +02:00
Support thermal printer for invoice
This commit is contained in:
parent
64f52d6c1c
commit
b4bec8964d
5 changed files with 84 additions and 60 deletions
|
@ -99,4 +99,28 @@ class Lang
|
|||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* $pad_type
|
||||
* 0 Left
|
||||
* 1 right
|
||||
* 2 center
|
||||
* */
|
||||
public static function pad($text, $pad_string = ' ', $pad_type = 0){
|
||||
global $config;
|
||||
$cols = 37;
|
||||
if($config['printer_cols']){
|
||||
$cols = $config['printer_cols'];
|
||||
}
|
||||
return str_pad($text, $cols, $pad_string, $pad_type);
|
||||
}
|
||||
|
||||
public static function pads($textLeft, $textRight, $pad_string = ' '){
|
||||
global $config;
|
||||
$cols = 37;
|
||||
if($config['printer_cols']){
|
||||
$cols = $config['printer_cols'];
|
||||
}
|
||||
return $textLeft.str_pad($textRight, $cols-strlen($textLeft), $pad_string, 0);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue