-
-
Notifications
You must be signed in to change notification settings - Fork 387
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
Rotate #188
Comments
Hi, share us photos, pieces of code of your problem. |
Seems to works only on text. Not on image, barcode or anything else. https://www.epson-biz.com/modules/ref_escpos/index.php?content_id=30 [Notes]
|
Maybe this will works : |
But this library use standard mode not page mode. |
Maybe you can try : Extend public class MyEscPosPrinterCommands extends EscPosPrinterCommands {
public static final byte[] ENABLE_PAGE_MODE = new byte[]{0x1B, 0x4C};
public static final byte[] PAGE_MODE_DIRECTION = new byte[]{0x1B, 0x54, 0x02};
/**
* Reset printers parameters.
*/
public EscPosPrinterCommands reset() {
if (!this.printerConnection.isConnected()) {
return this;
}
super.reset();
// ACTIVE HERE PAGE MODE AND DIRECTION
this.printerConnection.write(EscPosPrinterCommands.ENABLE_PAGE_MODE);
this.printerConnection.write(EscPosPrinterCommands.PAGE_MODE_DIRECTION);
return this;
}
} and do : EscPosPrinter printer = new EscPosPrinter(new MyEscPosPrinterCommands(deviceConnection, charsetEncoding), 203, 48f, 32); |
say me if it works |
Franck, I ran the tests now at my lunchtime, and it didn't work, below are the videos... I changed the modes, varying the hexadecimal code in the 3rd position of the Byte Array....according to EPSON's ESC/POS documentation, which you gave me.
Thank you for your attention and understanding of the matter. Yours sincerely, 1º 2º 3º |
Sorry it was my only option to solve your need. :( I don't know how do that. |
Thank you for the committed data, however, no problem. I will wait for another printer that we acquired ESC / POS to arrive from CHINA, who knows it works, then I will report it here. Thank you anyway. Note that in the image, it shows printing in another direction, certainly this one has the page mode option. Regards |
You can do that if you generate a Bitmap programmatically and print bitmap, but is more complicated. |
In fact, I saw another developer proposing a similar solution, however, I'll wait for the printer to arrive to test the solution you proposed directly in the library, however, if it doesn't work, I'll check the possibility of the bitmap. I don't know at what point I could get the byte array converted through ASCII, and convert it to bitmap, then rotate it using "Canvas"... I got a bit lost, where could I fit this solution into your LIB . Look at the proposal on another project. |
Good evening, passing to say that I solved my problem with printer above, it has ESC / POS support, but I used her SDK, called LPAPI, which allows to print the label using the drawings, X and Y, etc.. and so on. Via ESC/POS it is possible to print only Receipts, because this language uses the maximum size or width of the coil, whether 58mm or 80mm, so that it works with alignments to the left, center and right, that is, does not work with DPI. It would be even possible, but converting the label to Bitmap. Thanks! |
Can you please help me to solve this ? How can i print text and barcode 90% rotated ? |
It's not 90% but 90º, the printer has to be supported as CPLC, or ZPL, or TSPL languages. In the case of this NETUM printer, it has its own SDK or API that allows you to rotate images and texts, or shapes, in short, it's called LPAPI. |
can i have the link to this lpapi sdk please ? |
can you provide link to this LPAPI sdk please ? |
583mm = 58.3cm....0.6 meter. |
This value is for images alignment only. |
but isn't this hexadecimal value ? What is the last parameter printerNbrCharactersPerLine used for ? I've tried to half it from 32 to 16 to see if i can restrict the characters per line but failed :/ |
for text alignment, if you do [C]test or [R]test with 16 and 32, you will see a difference. |
Thanks, now i can see the changes.
I am trying to apply the chocolate solution of creating an image and rotating it by 90°, i have tried to figure out where should i apply in your code but it seems that i can't rotate the whole thing but it could be possible to rotate each line after transforming it to an image right ?
…________________________________
From: Franck Alary ***@***.***>
Sent: Wednesday, April 20, 2022 3:28 PM
To: DantSu/ESCPOS-ThermalPrinter-Android ***@***.***>
Cc: Eftychiou ***@***.***>; Comment ***@***.***>
Subject: Re: [DantSu/ESCPOS-ThermalPrinter-Android] Rotate (#188)
for text alignment, if you do [C]test or [R]test with 16 and 32, you will see a difference.
Is not for restriction. just used for alignment.
—
Reply to this email directly, view it on GitHub<#188 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ARL4ZVKDYKOQ2KRIGTTP3R3VF7Z7XANCNFSM5EUQRQTA>.
You are receiving this because you commented.Message ID: ***@***.***>
|
This cannot be work since |
Good afternoon, I've implemented zebra printer support in my App, for printing labels it's an excellent printer, posi offers support for printing using ZPL, EPL language that allows you to position elements very easily. However, as it is an extremely expensive printer here in BRAZIL, since it is quoted in dollars, to acquire a PT-210 ESC/POS printer from CHINA, and I loved this library, but I have difficulty rotating the elements that are printed on paper, that is, 90 degrees. I looked in the ESC/POS specification... for a way to do this, I even found the byte[] hex that allows you to rotate the element, but when I send a text, it prints everything in a single column, it doesn't distribute it horizontally.
Att
Sebastiao Fidencio
The text was updated successfully, but these errors were encountered: