473,765 Members | 1,869 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Printing Escape codes to a printer

I need to send printer specific escape codes a printer for a POS register. Can anyone tell me how to send these codes to a printer using VB .NET and the Win32 spooler functions? I have looked at the MS article 322090 on how to do this but the supplied code doesn't work for the second button. Please let me know if there are any other resources on Windows printing. It would be greatly apreciated. Thanks for any and all help.
Nov 20 '05 #1
1 2454
Hi,

I have looked at the MS article 322090 on how to do this but the supplied
code doesn't work for the second button.
<<

What do you mean, "second button?" Does this refer to a specific command
that you must issue to the printer?

When I do this, I bypass the spooler and write directly to the printer IO
port (much faster than using the spooler). I use the DriverLinx PortIO
driver (free, but requires registration with SST). I have VB6 code that
does this, and I've though of porting it to .NET (this is an hour or two of
work that I haven't had time for).

Dick

--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 3rd
Edition ISBN 1-890422-27-4 (391 pages) published February 2002.
Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
24898
by: Brian Hanson | last post by:
Hi, I am trying to programmatically print a pdf file via an asp.net application. I have seen other postings that mention the following code used or something similar to it in a vb.net app. Process.Start("C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe", "/p /h ""C:\Program Files\Adobe\Acrobat 5.0\Help\ENU\ACROBAT.PDF""")
1
3968
by: PW | last post by:
I have to setup a point-of-sale system for a friend. He has a PC, barcode scanner, receipt printer and cashdrawer. The receipt printer connects to the serial port. The cashdrawer connects to the printer. The barcode scanner has a keyboard wedge. Do I need to setup the receipt printer as a windows printer ? OR can I send output directly to the serial port using ASP ?
0
1200
by: Samuel Lee | last post by:
Could anyone convert the following vb 6.0 codes into vb.net version? '************************************************************************ '** Button to print a sales receipt - spool print data to receipt printer '************************************************************************ Private Sub cmdPrintReceipt_Click() Printer.CurrentX = 0: Printer.CurrentY = 0 Printer.FontName = "Arial"
2
14748
by: David Cuffee | last post by:
I am not having any luck printing a simple text file with PCL codes to my windows printer. If I have a text file with PCL codes and I want to dump that file to my default windows printer, how would I do that in C#? I tried just putting the printDocument1 object on my form and doing this: printDocument1.DocumentName = "C:\\Tablerep.prn"; printDocument1.print();
6
1169
by: Rand | last post by:
Hello anyone, Situation: I want to print 1 or x mailing continuous form labels 1" X 3.5" then change to a different name and print again. Everything works fine except for problem below. Problem: Unwanted form feed after printing.
5
12823
by: Tom | last post by:
I am converting an old application that was printing directly to a specialized printer device (i.e. a special label printer). It was doing this by opening a file with the file path of 'LPT1:' and then using PRINT # to print directly to the printer device. Obviously, this is not going to work under VB.NET - StreamWriter won't let you open a device like LPT1: and such. I assume I am going to have to switch to the System.Drawing.Printing...
1
2874
by: Paul H | last post by:
I am developing a database where some reports need to print to a laser and some need to print to a dot matrix printer. I am not interested in how to do this programmatically, I will let the user manually select the printer for each report, my question is..... Is printing to a dot matrix printer the same (as far as Access in concerned) as printing to a laser or inkjet printer? Do I just create the report, set the margins and click...
0
1439
by: mottebelke | last post by:
I want to print a bitmap directly to a network printer using a socket. To do this I use PCL codes to set the printer in the right mode and print the image. Note that this code is used on the Compact Framework, so there is no PrintDocument or even a driver I can use. try {
1
6124
by: sathyp | last post by:
Public Function SetPrinterDefaultsW(ByVal sPrinterName As String, _ ByVal nPaperSize As Long, ByVal nOrientation As Long) As Boolean Dim Prn As Printer Dim hPrinter As Long Dim pd As PRINTER_DEFAULTS Dim pinfo2 As PRINTER_INFO_2 Dim pinfo8 As PRINTER_INFO_8 Dim pinfo9 As PRINTER_INFO_9 Dim dm As DEVMODEW Dim yDevModeData() As Byte
0
9566
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9946
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9832
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6646
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5272
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5413
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3921
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3530
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.