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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Dos Based printing in VB while using printer object.

Thread ID:

Created:

Updated:

Platform:

Replies:

5001 Jun 13,2003 07:54 AM UTC Jan 16,2004 04:32 AM UTC WinForms 5
loading
Tags: FAQ
Sanjay K Dixit
Asked On June 13, 2003 07:54 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

Administrator [Syncfusion]
Replied On 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 >

muji gopinath
Replied On 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 >

h patel
Replied On January 16, 2004 04:26 AM UTC

mail me on this email id infosilex@yahoo.com

h patel
Replied On 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

h patel
Replied On 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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;