Skip to content Skip to sidebar Skip to footer

Receipt Printer - Print From Webpage

I have a receipt Printer and it connected to Serial COM1 on to my comuter. I am trying to print a receipt from the webpage and when it print... it just a blank without any text. (B

Solution 1:

If you are willing to load a java applet, jzebra can print directly to the Epsom TM series thermal printers to COM1 port using the Generic Text driver as you've described.

https://github.com/qzind/qz-print

The problem you are encountering is not uncommon. Generic/Text bypasses the PostScript (2D) capabilities of the Epson print driver.

If using Generic/Text, Epson uses the ESC/P programming language. You will find many tutorials on the internet for printing in this format, and jzebra has more information about this style of "RAW" printing here:

https://github.com/qzind/qz-print/wiki/Raw-Printing

Edit:

To get this working, simply setup your receipt printer as the default printer and rename it as "zebra":

enter image description here

Then simply download the qz-print library, put the jar file in the project directory and hey presto:

<inputtype=buttononClick="print()"value="Print"><appletid="qz"code="qz.PrintApplet.class"archive="./qz-print.jar"width="100"height="100"><paramname="printer"value="zebra"></applet><script>functionprint() {
       qz.append("PRINTED USING JZEBRA\n");
       qz.print();
      }
</script>

enter image description here

Solution 2:

This is very old question, but it is still difficult to find a good solution. I used to use QZ Tray solution (as Tres Finocchiaro has described), but now I think I've found a better one that provides full control over the process:

  1. Register custom protocol (like "https", "http", "mailto") named, for instance, "print". It is done using registry editor in Windows.
  2. Write a custom protocol handing application which will be automatically executed by Windows when somebody is going to open a link like "print://any/parameters/go/here".
  3. Implement printing in your application. I'm using C# and built-in PrintDocument class, so it is extremely simple.

Now I can just create a link with href like "print://invoice/1234" and then parse this URI in your application and print whatever you need. It works even from a command line.

The printing result photo

Here you can get more information.

Solution 3:

a solution: Have a look at jQPrint

EDIT:

Have a look at jQuery or other javascript plugins that do this, try jQPrint if it's still supported or try searching if the link is broken. I realise this is an old answer and they type of answer that is no longer permitted. Hopefully this helps.

Post a Comment for "Receipt Printer - Print From Webpage"