How to Print in non graphics mode 
Author Message
 How to Print in non graphics mode

I have this problem:

With VB4, I want to print to a printer in non graphics mode to obtain a
most rapidly print with the default caracter (Utility or draft). (For
printer while Epson LQ-1050+)

In VB4 I normally use Printer.Print to print to a printer, but this
method print always in graphics mode.

Can I send a text file directly to the spooler with a function (DLL) of
Windows???

I'm sorry for my english.

                                        Champion Data



Mon, 14 Feb 2000 03:00:00 GMT  
 How to Print in non graphics mode

Here's some code I copied from another post on this newsgroup a couple of
weeks ago.  I hope it helps.  I haven't tried it, but it is supposed to
"copy" a text file to the printer.

Annette Gates

Private Declare Function OpenPrinter& Lib "winspool.drv" Alias
"OpenPrinterA" (ByVal pPrinterName As String, phPrinter As Long, ByVal
pDefault As Long)

Private Declare Function StartDocPrinter& Lib "winspool.drv" Alias
"StartDocPrinterA" (ByVal hPrinter As Long, ByVal Level As Long,
pDocInfo As DOC_INFO_1)

Private Declare Function StartPagePrinter& Lib "winspool.drv" (ByVal
hPrinter As Long)

Private Declare Function WritePrinter& Lib "winspool.drv" (ByVal
hPrinter As Long, pBuf As Any, ByVal cdBuf As Long, pcWritten As Long)

Private Declare Function EndDocPrinter& Lib "winspool.drv" (ByVal
hPrinter As Long)

Private Declare Function EndPagePrinter& Lib "winspool.drv" (ByVal
hPrinter As Long)

Private Declare Function ClosePrinter& Lib "winspool.drv" (ByVal
hPrinter As Long)

Private Sub mnuFilePrint_Click()
  CMDialog1.CancelError = True
  On Error GoTo ErrHandler
  frmSDI.CMDialog1.Flags = cdlPDReturnDC Or cdlPDHidePrintToFile Or
cdlPDNoSelection Or cdlPDNoPageNums Or cdlPDAllPages
  frmSDI.CMDialog1.ShowPrinter

' go directly to the printer
Dim hPrinter&
Dim PrinterName$
Dim jobid&
Dim res&
Dim written&
Dim printdata$
Dim docinfo As DOC_INFO_1
PrinterName$ = Printer.DeviceName
res& = OpenPrinter(PrinterName$, hPrinter, 0)
If res& = 0 Then
  MsgBox "Can't open printer"
  Exit Sub
End If
docinfo.pDocName = "Viewer Output"
docinfo.pOutputFile = vbNullString
docinfo.pDatatype = vbNullString
jobid = StartDocPrinter(hPrinter, 1, docinfo)
Call StartPagePrinter(hPrinter)
Open strOpenFileName For Input As #8
printdata$ = Input(LOF(8), 8)
Close #8
Call WritePrinter(hPrinter, ByVal printdata$, Len(printdata$), written)
Call EndPagePrinter(hPrinter)
Call EndDocPrinter(hPrinter)
Call ClosePrinter(hPrinter)

  Exit Sub

ErrHandler:
    ' User pressed the Cancel button
    Exit Sub

End Sub


Quote:
> I have this problem:

> With VB4, I want to print to a printer in non graphics mode to obtain a
> most rapidly print with the default caracter (Utility or draft). (For
> printer while Epson LQ-1050+)

> In VB4 I normally use Printer.Print to print to a printer, but this
> method print always in graphics mode.

> Can I send a text file directly to the spooler with a function (DLL) of
> Windows???

> I'm sorry for my english.

>                                    Champion Data




Tue, 15 Feb 2000 03:00:00 GMT  
 How to Print in non graphics mode

What you need to do is choos a printer-specific font, and change the
default font of the printer object to that. Check the Printer.Fonts
Collection to find these appropriate fonts.

Quote:

> I have this problem:

> With VB4, I want to print to a printer in non graphics mode to obtain a
> most rapidly print with the default caracter (Utility or draft). (For
> printer while Epson LQ-1050+)

> In VB4 I normally use Printer.Print to print to a printer, but this
> method print always in graphics mode.

> Can I send a text file directly to the spooler with a function (DLL) of
> Windows???

> I'm sorry for my english.

>                                         Champion Data




Wed, 16 Feb 2000 03:00:00 GMT  
 How to Print in non graphics mode

Will you tell me how to use the codes for vb i am new to this and i need help

                          -Xx0PuNt0xX-



Thu, 24 Feb 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Printing on coloured backgrounds in graphics mode

2. Printing Mode 13 graphics in QB4.x

3. Using PRINT statements in graphics mode

4. SET Field with non-print non-space character

5. Printing in MS-DOS mode over Win9x (condensed mode, Draft, etc)

6. Winsock / WSOCK32.DLL - Setting a socket to non-blocking mode in VB4

7. webbrowser control in non-3D mode

8. Winsock / WSOCK32.DLL - Setting a socket to non-blocking mode in VB4

9. getting print file to non-installed network print queue

10. Incorporating non-QBasic graphics into QB 4.5 programs

11. Fast non directx graphics - how?

12. Graphics mode in .Net console?

 

 
Powered by phpBB® Forum Software