| Re: Printers -
06-04-2007, 08:53 AM
1) Try ***igning the required pitch to a variable such as pptich(0)= "12 CPI
HSD", ppitch(1) = "10 CPI UTILITY". Therefore you can ***ign the required
pitch with a simple Option button choice before the document is printed
(ie:Printer.Font = ppitch(x)) .
2) I'm not sure what you're asking for but there are many ways to find the
printdevice on a system. Here is a small API function that returns the
printer properties. From that you can write some code for use with the
printers you desire.
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 PrinterProperties Lib "winspool.drv" (ByVal hwnd As
Long, ByVal hPrinter As Long) As Long
Private Sub Form_Load()
Dim hPrinter As Long
OpenPrinter Printer.DeviceName, hPrinter, ByVal 0&
PrinterProperties Me.hwnd, hPrinter
ClosePrinter hPrinter
End Sub
I hope this helps a little.
"Joel Ribiat" <EMAIL REMOVED> wrote in message
news:F%Myb.11058$EMAIL REMOVED...
> We are a small programming company that has customers with Okidata
printers
> (set to IBM emulation). We do not want to print in a font that would
result
> in near letter quality printing as it is very slow. So in our code we have
> printer.font = "12 CPI HSD", or "10 CPI UTILITY". Sometimes we need 12
> pitch, other times 10 pitch. If anyone can help with these questions, it
> would be appreciated:
> 1) After the printer.enddoc command, do we need to set the printer back to
> some sort of default? Because it seems if we do the 12-pitch, it stays in
> 12-pitch.
> 2) Sometimes, our customers might want to print their invoice to a laser
> printer, in which case the above fonts won't work. Is there a way to
> determine if the current printer is a laser/inkjet so we can use a
different
> pitch and/or font?
> 3) If we set our Okidata dot matrix driver to Generic / Text Only, then it
> prints in HSD mode, but doesn't recognize any commands. Maybe there's a
> trick to getting it to recognize pitch?
>
> If someone has an article or web site on the inner workings of the printer
> object, that would be great. So far, I'm having trouble finding out what
all
> the commands are
>
> |