fabienbellanger / escpos-rs Goto Github PK
View Code? Open in Web Editor NEWESC/POS implementation in Rust
Home Page: https://docs.rs/escpos
License: Other
ESC/POS implementation in Rust
Home Page: https://docs.rs/escpos
License: Other
Thank you for this wonderful crate. There is one thing that I don't understand. How can the Encoding be set to a specific page code of the printer? As I see that French is supported, I suppose that there is a way to do it, but I was able to do that in crates that used the original Encoding crate, I cannot finf a way to customize the used Encoding.
@fabienbellanger Hello, thank you for opening up such an excellent project. I am a Rust beginner and I do not understand the underlying communication principles. I want to call the Rust program to implement cross platform USB ticket printing in an Electron based project, but 'escpos-rs' depends on' libusb'. I don't know how to package 'libusb ' into the project to reduce the process of users installing 'libusb'. I have found that nusb is a pure Rust library. Can escpos-rs rely on nusb
connecting to USB printer devices
Are there any plans on supporting printer status? Currently, even when the print is not successful we do not get any feedback (e.g., when the printer is connected but there is no paper). For my use case, I need to know whether the print was successful or not. I started looking into the DLE EOT n command (https://download4.epson.biz/sec_pubs/pos/reference_en/escpos/dle_eot.html) and could get the status for my printer but it looks like I am always getting the status from the previous request (when I have time I will do some more tests). But I was wondering, since you already implemented the custom command, I could probably get away with it, but I would need a way to listen back from the printer, do you have any plans on it?
I could not find any example of how to print using USB, could you provide an example (preferably on Windows)?
Thank you for your work on this crate.
Thank you for the code!
This project is great, can it support print order receipt with table, similar to the following example:
https://github.com/jamhall/recibo/blob/main/examples/receipt.rs
First off, I would like to thank you for putting this library together. I found it much better than the other options.
Now I'm no Rust expert but I was working on a simple GUI app that utilizes this crate. In doing so I ran into an issue where I needed JustifyMode
to implement the Copy
and Clone
traits.
The code in question is in types.rs
Here is a simple example that causes the issue:
use escpos::utils:*;
struct Demo {
j: JustifyMode,
}
impl Demo {
fn temp(&self) {
self.j;
}
}
fn main() {
// code omitted here for simplicity
}
The error it produces is:
cannot move out of `self.j` which is behind a shared reference
move occurs because `self.j` has type `escpos::utils::JustifyMode`, which does not implement the `Copy` trait
/// Justify mode
#[derive(Debug)]
pub enum JustifyMode {
LEFT,
CENTER,
RIGHT,
}
/// Justify mode
#[derive(Debug, Clone, Copy)]
pub enum JustifyMode {
LEFT,
CENTER,
RIGHT,
}
I have a fork where I have made these changes. Let me know and I can make a Pull Request.
If this is not needed because there is a better way to do it, please let me know.
Thanks again for your work here!
Is there a plan to TSC label printer support?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.