Giter VIP home page Giter VIP logo

receiptio's Issues

ability to print with xprinter printer

hi,
thanks for a very excellent application.
the concept is really great!!.
i have an xprinter which i want to connect to with receiptio on windows 10.
i am able to do test prints with windows os and the printer works fine.
but when i try connecting using xprinter it does not seem to work and i always get the disconnect(105) message when i try printing using receiptio whether on the command line or when using the library from a nodejs application.
i checked the list of supported printers but i noticed the xprinter series of printers wasn't supported.
is this support coming anytime soon or is there some sort of workaround around this.
thanks!!.

Question - API options for dots/cpl and spacing

Great library! I'm personally only interested in generating digital receipts, without the need of the printer, through the API.

I wasn't sure which options actually allow to set the width and increase spacing, just like https://receiptline.github.io/designer/? Would that be done through character limitation only? Also, is there a way to set a specific font during render (e.g., <span style="font-family:Papyrus; font-size:4em;">Thanks!</span>)? I'm trying to make it look a bit more alike with the US & CA standard.

Left margin option

Hi,

In the industry I work on it is very common that ticket paper has a color brand stripe to the left side:
ticket-stripe

In order for the text not be placed over the stripe, some precautions should be taken.

My solution is to add a "margin" parameter ("-m") to receiptio, and then overwrite the "area" command accordingly:

const transform = async (receiptmd, printer) => {
    // ...
    // ...
    if (printer.leftMargin) {
        printer.command = Object.assign(
            {}, 
            typeof printer.command === 'object' ? printer.command : receiptline.commands[printer.command]
        );

        // overwrite area function
        const a = printer.command.area;
        printer.command.area = (left, width, right) => a(left + printer.leftMargin, width, right - printer.leftMargin);
    }
    
    return receiptline.transform(receiptmd, printer);
};

Also, the parameter cpl might need to be adjusted.
i.e. with a cpl of 48 and a leftMargin of 2, will give a total width of 50, forcing the wrapping of every line.

So, when cpl is not manually provided it should be adjusted:
cpl = default - leftMargin

I'm unsure this should be part of the receiptline or the receiptio tool. My implementation is on receiptio, but it might also fit as a general parameter in receiptline.
It could also be extended to right margin, of course.

Regards,

Usb interface port names question

This command works flawlessly and prints. The printer is attached to a network.
"receiptio -d 192.168.1.60 -p generic receiptline.txt"

I tried to transfer the printer by plugging it in my system through USB.
"receiptio -d lpt1 -p generic receiptline.txt"
"receiptio -d USB002 -p generic receiptline.txt"
These commands returns "disconnect". How can I know the proper port/name of the printer?

This is the configuration of windows and the information stated in Device Manager.
Screenshot 2023-01-31 222328

Im on Windows 11 and the printer is a Generic 80mm Thermal.

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.