none
How to paper reverse feed in Dot Matrix Printer RRS feed

  • Question

  • In my application i am printing invoices by dot matrix printer. Paper has feed up 2 Inches from printer head. The problem is how to reverse feed 2 Inches the paper. Is there any source code for it .or simply the printing should start from the beginning of the paper. I am using EPSON KX-310 ESC/P. I was developed in Visual Basic 2012 printdocument.

    dopenoinam

    Sunday, June 18, 2017 1:42 PM

All replies

  • In my application i am printing invoices by dot matrix printer. Paper has feed up 2 Inches from printer head. The problem is how to reverse feed 2 Inches the paper. Is there any source code for it .or simply the printing should start from the beginning of the paper. I am using EPSON KX-310 ESC/P. I was developed in Visual Basic 2012 printdocument.

    dopenoinam

    According to this website - it is ESC j n

    You need to send chr(27) & chr(106) & chr(n) - where n is how far in 1/216ths of an inch you want to back up the paper. for a 2 inch reverse my GUESS is to send 27 106 216 twice, not 27 106 432
    Sunday, June 18, 2017 2:37 PM
  • I believe you have to send an <esc> sequence for the command which is quite difficult and printer specific. Normally listed in the tech manual for the device.

    https://support.microsoft.com/en-us/help/322091/how-to-send-raw-data-to-a-printer-by-using-visual-c-.net

    I have never done it in vb.net.

    Since you have not responded to my responses to your other posts I am not going to bother.

    But, might be fun for someone that likes using NativeMethods.


    PS BTW I think you will need the device to test it.
    Sunday, June 18, 2017 2:41 PM
  • Where put this code


    dopenoinam

    Sunday, June 18, 2017 2:51 PM
  • Where insert ESC j n this code. I have not idea for printing source code.

    How to Adjust this area


    dopenoinam

    Sunday, June 18, 2017 3:56 PM
  •  My best guess would be to use the SerialPort Class`s  Write Method to send a Byte array or Char array of the escape code values (0-255) or the ASCII character of that value to the printer.  The Escape codes that it appears you are looking for are the (ESC,  J,  n) and (ESC,  j,  n) codes as can be found in the two links below.  The n value in the 3rd Char or Byte is the fractional value of an inch is what i take from the note on that code description found in the first link.  Apparently most of these Epson printers use these same codes.

     Look in the "Vertical/Horizontal Motion:" section of this link for the two codes i showed above,  one with a capital "J" and one with a lower case "j".  One is to feed the paper forward by the fractional amount of inches and the other is to feed the paper backward by the given amount.

    Epson Printer Codes

    EPSON ESC/P 2 PRINTER COMMAND CODES

     However,  as Tom mentioned,  you need more info on the specific printer itself so you know things like the baud rate,  start and stop bits and any other info you need in order to set up the serial port to connect and send a command to the printer.

      

     Edit:  Here is a link to a PDF document that has more info on the ESC P and ESC P2 Epson printers.  I saw the Start and Stop bit info in there,  plus more info on the command codes.  It will be handy to have if you don`t already.

     https://files.support.epson.com/pdf/general/escp2ref.pdf


    If you say it can`t be done then i`ll try it

    • Edited by IronRazerz Sunday, June 18, 2017 10:34 PM
    Sunday, June 18, 2017 5:28 PM
  • Where insert ESC j n this code. I have not idea for printing source code.

    You can't just insert the code in your document.  You are printing to a printer driver, not to a printer, and the printer driver does not understand ESC P codes.

    Your printer should have a configurable option to roll back the paper at the first received character after a form feed.  Otherwise, it may have an option to feed forward the paper for tearoff, and then automatically roll it back.  You need to consult the printer manual. 

    If those options aren't available then you could achieve what you want by using the printer in device mode and sending your ESC P control codes and printable text to the printer through the serial port. 

    Monday, June 19, 2017 12:27 AM