Giter Site home page Giter Site logo

escpos-rs's People

Contributors

bandeveloper avatar bhavya32 avatar fabienbellanger avatar garmelon avatar ldicocco avatar syllasrangel avatar travisbaars avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

escpos-rs's Issues

How to print characters with umlaut or accents?

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.

about usb

@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

Support for printer status

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?

How to print via USB?

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.

Implementing Copy and Clone for the JustifyMode enum

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

Current code

/// Justify mode
#[derive(Debug)]
pub enum JustifyMode {
    LEFT,
    CENTER,
    RIGHT,
}

Proposed change

/// 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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.