Printers

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joel Ribiat

    Printers

    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


  • edoepke

    #2
    Re: Printers

    1) Try assigning the required pitch to a variable such as pptich(0)= "12 CPI
    HSD", ppitch(1) = "10 CPI UTILITY". Therefore you can assign the required
    pitch with a simple Option button choice before the document is printed
    (ie:Printer.Fon t = 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.d rv" Alias "OpenPrinte rA"
    (ByVal pPrinterName As String, phPrinter As Long, pDefault As Any) As Long
    Private Declare Function ClosePrinter Lib "winspool.d rv" (ByVal hPrinter As
    Long) As Long
    Private Declare Function PrinterProperti es Lib "winspool.d rv" (ByVal hwnd As
    Long, ByVal hPrinter As Long) As Long
    Private Sub Form_Load()

    Dim hPrinter As Long
    OpenPrinter Printer.DeviceN ame, hPrinter, ByVal 0&
    PrinterProperti es Me.hwnd, hPrinter
    ClosePrinter hPrinter
    End Sub

    I hope this helps a little.



    "Joel Ribiat" <joel@ecsnj.com > wrote in message
    news:F%Myb.1105 8$n4.6257@nwrdd c01.gnilink.net ...[color=blue]
    > We are a small programming company that has customers with Okidata[/color]
    printers[color=blue]
    > (set to IBM emulation). We do not want to print in a font that would[/color]
    result[color=blue]
    > 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[/color]
    different[color=blue]
    > 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[/color]
    all[color=blue]
    > the commands are
    >
    >[/color]


    Comment

    • J French

      #3
      Re: Printers

      My inclination would be to bypass the printer driver and print
      directly to the Spooler using the OpenPrinter API

      Not exactly the 'Windows Way', but OKI line printers are not really
      Windows printers

      IIRC there is a command for setting OKIs back to their 'turn on' state
      - however it is probably better to explicitly do this yourself

      Another poster answered most of the rest.

      On Mon, 01 Dec 2003 19:54:13 GMT, "Joel Ribiat" <joel@ecsnj.com >
      wrote:
      [color=blue]
      >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
      >
      >[/color]

      Comment

      Working...