-
Notifications
You must be signed in to change notification settings - Fork 855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
str_pad will result in a new line #544
Comments
You might just need to change some numbers. I wrote that example for a printer with 48 characters per line and your printer looks like it's narrower, maybe 42. Look for class item
{
...
public function __toString()
{
$rightCols = 10;
$leftCols = 38;
if ($this -> dollarSign) {
$leftCols = $leftCols / 2 - $rightCols / 2;
}
$left = str_pad($this -> name, $leftCols) ;
$sign = ($this -> dollarSign ? '$ ' : '');
$right = str_pad($sign . $this -> price, $rightCols, ' ', STR_PAD_LEFT);
return "$left$right\n";
}
} It is currently |
Shame on me, I should have seen this ... Big thanks mike ! :) |
I also notice that you have an "ñ" sign on your receipt. Since you are writing in French, I'm guessing you are trying to print a Euro. If you upgrade to v2.0.1, you can use the A sort of minimal example would be- use Mike42\Escpos\CapabilityProfile;
use Mike42\Escpos\Printer;
use Mike42\Escpos\PrintConnectors\FilePrintConnector;
$profile = CapabilityProfile::load("TM-T88IV");
$connector = new FilePrintConnector("/dev/usb/lp0");
$printer = new Printer($connector, $profile);
$printer -> text("Article gratuit € 0,00\n");
$printer -> cut();
$printer -> close(); |
Thanks you so much ! |
can i use grid
20 Indomie Goreng(break if long text) Rp12.500 IDR |
Hello,
I've tried the receipt-with-logo example and the lines are not aligned on right. It does a new line below the first. I have the item on the left and its price below the item (it should be on the right).
My printer is a Epson TM-T88IV. Is there any config to do to adjust the paper width or the print size (or something else ?) :)
![29261500_10208750308873721_2964178959303966720_o](https://user-images.githubusercontent.com/6755302/37468377-2d12364c-2863-11e8-8ac6-b4c975aa585e.jpg)
Thanks (and sorry for my english).
The text was updated successfully, but these errors were encountered: