Avatar of pvg1975
pvg1975Flag for Argentina

asked on 

Print to POS printer - Problem cutting paper in VB.NET

Hello all,

Im printing on a POS receipt printer as follows (VB.NET):

args.Graphics.DrawString("Hello World", New Font("Arial", 8, FontStyle.Regular), Brushes.Red, 0,0)

but when trying to cut the paper, its not working:

Const ESC = Chr(27)
Dim strCut As String
strCut = ESC & "i"
args.Graphics.DrawString(strCut, New Font("Arial", 8, FontStyle.Regular), Brushes.Red, 0, 0)

The manual say the following:

Partial cut
Code: ASCII ESC i
Hex 1B 69
Decimal 27 105

This command executes a partial cut of the paper with one point left uncut.
The same partial cut as this command is executed using ESC m and GS V.

That's why I set strCut as ESC + "i"

But aint working....

Any tips? Thanks!
Visual Basic.NETPrinters and Scanners

Avatar of undefined
Last Comment
Nasir Razzaq
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

You need to send that character to the printer not print it. With drawstring, that character is being DRAWN. You need to send the characters to printer. Try using the RawPrinterHelper class

http://support.microsoft.com/kb/322091

http://www.codeproject.com/Answers/169800/Print-and-send-commands-to-receipt-printer.aspx#answer1 
Avatar of pvg1975
pvg1975
Flag of Argentina image

ASKER

Any way to do that in VB.NET?
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of pvg1975
pvg1975
Flag of Argentina image

ASKER

Sorry for the delay in my answer... it worked. Thanks!!!
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Glad to help :-)
Visual Basic.NET
Visual Basic.NET

Visual Basic .NET (VB.NET) is an object-oriented programming language implemented on the .NET framework, but also supported on other platforms such as Mono and Silverlight. Microsoft launched VB.NET as the successor to the Visual Basic language. Though it is similar in syntax to Visual Basic pre-2002, it is not the same technology,

96K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo