0

i am trying to Cut paper after every line in VB6 here is the code

Open "LPT1" For Output As #1
Print #1, Chr$(&H1B); "@"; 'Initializes the printer (ESC @)
Print #1, Chr$(&H1B); "d"; Chr$(0); 'Prints and line feeding (ESC d)
Print #1, Chr$(&H1B); "!"; Chr$(17); 'Selects double-height mode
For a = 1 To 5
Print #1, "14-January Invoice 01000"; Chr$(&HA); 'Prints and line feed
Print #1, Chr$(&H1B); "m"; Chr$(&HA); 'Cut Paper
Next
Print #1, Chr$(&H1D); "V"; Chr$(66); Chr$(0);
Close #1

it should be printing a line after then cut the paper but it start cutting paper from the top

any body can help me on this?

update: basically what i want is to make small tags where date and invoice written on it and tag max 1 cm long.

mortypk
  • 46
  • 1
  • 11

1 Answers1

0

You are performing a partial cut (ESC m) inside of your loop, after every line you are printing. I think you probably want to remove that line:

Print #1, Chr$(&H1B); "m"; Chr$(&HA); 'Cut Paper

After the loop, you then perform a feed-and-cut (partial cut) operation (GS V 66 0) after the loop completes. I think you probably want to keep that line to perform the cut after you've printed.

MarkL
  • 1,721
  • 1
  • 11
  • 22
  • thanks for reply i am using (ESC m) because i need partial cut using (GS V 66 0) will give a big gap. – mortypk Apr 19 '16 at 02:19
  • basically what i want is to make small tags where date and invoice written on it and tag max 1 cm long. – mortypk Apr 19 '16 at 02:34
  • The metrics vary by the printer model, but `ESC m` will cut at the current roll position - generally you have to feed up some number of lines before cutting or you're cutting 'too soon'. That's exactly what `GS V 66 0` is intended to do - it feeds the paper so that any current printing is up and out of the way before cutting. You could try printing additional blank lines before cutting, but be aware that if a different printer vendor/model is used, you may not get the same results. – MarkL Apr 19 '16 at 14:18
  • Also, `ESC m` is considered obsolete, so you should consider using one of the other `GS V` modes (see [ESC POS reference](https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=87), registration required). – MarkL Apr 19 '16 at 14:19
  • can you advise better way in which i can cut the paper after evey line? i am also working other way like (vb6 Printer object where i set Printer.CurrentY and then cut but main problem in this is if i set the location for single tag that location does not work on 2 tag or 3 tag) i am using printer BIXOLON SRP-275. – mortypk Apr 19 '16 at 16:18
  • Unfortunately, no. Seems to me that you're trying to implement a non-standard usage of this type of printer. So your best strategy could be to print additional lines in the loop, using trial-and-error until you get the result desired. If you need finer distance control than the default line spacing provides, see the `ESC 3` command to change the line spacing (`ESC 2` or `ESC @` resets line spacing to the default). Note that if you do change your printer model, you may have to re-adjust this code (because the distance between the print head and cutter can be different for another printer type). – MarkL Apr 19 '16 at 18:14
  • yea you are right about different model /different result. but right now i am working on BIXOLON SRP-275 can you give me detail about esc 3 (also esc 3 can be worked on fontControl command) – mortypk Apr 20 '16 at 03:10