We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Dos Based printing in VB while using printer object.

Dear Sir, Graphical printing is slow for Dot Matrix Printer (DMP). Whenever I Start printing on DMP from VB application using printer object. It is slower than MS DOS based printing. I want to print on DMP as MS DOS based Fast printing from VB application using Printer Object in VB ? Please help me out. With Lov Prg. Sanjay K Dixit

5 Replies

AD Administrator Syncfusion Team November 12, 2003 07:02 AM UTC

> Dear Sir, > > Graphical printing is slow for Dot Matrix Printer (DMP). Whenever I Start printing on DMP from VB application using printer object. It is slower than MS DOS based printing. > I want to print on DMP as MS DOS based Fast printing from VB application using Printer Object in VB ? > Please help me out. > > With Lov Prg. > > Sanjay K Dixit >


MG muji gopinath November 28, 2003 02:12 PM UTC

i too have the same quries to get a reply will any one help me also in this regard thank you muji > Dear Sir, > > Graphical printing is slow for Dot Matrix Printer (DMP). Whenever I Start printing on DMP from VB application using printer object. It is slower than MS DOS based printing. > I want to print on DMP as MS DOS based Fast printing from VB application using Printer Object in VB ? > Please help me out. > > With Lov Prg. > > Sanjay K Dixit >


HP h patel January 16, 2004 04:26 AM UTC

mail me on this email id infosilex@yahoo.com


HP h patel January 16, 2004 04:30 AM UTC

Private Declare Function WritePrinter Lib "winspool.drv" _ (ByVal hPrinter As Long, _ pBuf As Any, _ ByVal cdBuf As Long, _ pcWritten As Long) As Long Private Declare Function OpenPrinter Lib "winspool.drv" _ Alias "OpenPrinterA" _ (ByVal pPrinterName As String, _ phPrinter As Long, _ pDefault As Any) As Long Private Declare Function ClosePrinter Lib "winspool.drv" _ (ByVal hPrinter As Long) As Long Private Declare Function StartDocPrinter Lib "winspool.drv" _ Alias "StartDocPrinterA" _ (ByVal hPrinter As Long, _ ByVal Level As Long, _ pDocInfo As Byte) As Long Private Declare Function EndDocPrinter Lib "winspool.drv" _ (ByVal hPrinter As Long) As Long Private Sub Print_File(FName As String) Dim StrToPrint As String Dim LngPrinted As Long Dim lhPrinter As Long Dim PrntErr As Long If (FName = "") Then MsgBox "Nothing to Print", vbCritical, "Error" Exit Sub End If PrntErr = OpenPrinter(Printer.DeviceName, lhPrinter, 0&) If (PrntErr = 0) Then MsgBox "Error in Printing ", vbCritical, "Error" Exit Sub End If PrntErr = StartDocPrinter(lhPrinter, 1, 0&) If (PrntErr = 0) Then 'Printer is Directly connected to the Machine Call Prnt_2_Port(FName) Exit Sub End If Open FName For Input As #1 StrToPrint = "" While Not EOF(1) Line Input #1, StrToPrint StrToPrint = StrToPrint + Chr(13) + Chr(10) WritePrinter lhPrinter, ByVal StrToPrint, _ Len(StrToPrint), LngPrinted Wend EndDocPrinter lhPrinter ClosePrinter lhPrinter Close #1 End Sub


HP h patel January 16, 2004 04:32 AM UTC

Sub Prnt_2_Port(FName As String) Open FName For Input As #1 'Since the Printer might be connected to LPT1 or LPT2 it 'had been changed to Printer.Port - KSM (21/11/2002) 'On Error GoTo To_NPrint Open Printer.Port For Output As #2 StrToPrint = "" While Not EOF(1) Line Input #1, StrToPrint If Right(StrToPrnt, 1) = " " Then StrToPrnt = Mid(StrToPrnt, 1, Len(StrToPrnt) - 1) Print #2, StrToPrint Wend Close #2 Close #1 Exit Sub

Loader.
Up arrow icon