none
Fonts, Printer Device Specific RRS feed

  • Question

  • My Printer Device (CBM 1000) needs a special font ('Control') to
    access special functions like opening cash drawer. How do I print
    to the device using such a font that is device specific ?
    In vb6 it was easy: just to say that Printer.FontName = "Control".
    But in .NET 2.0, how is that done ?

    Best regards,
    Seppo

    Thursday, March 8, 2007 1:31 PM

All replies

  • Seppo,

    Please try the following code in VB.NET:

    Public Sub Printing()

        Try

            streamToPrint = New StreamReader(filePath)

            Try

                printFont = New Font("Arial", 10)

                Dim pd As New PrintDocument()

                AddHandler pd.PrintPage, AddressOf pd_PrintPage

                ' Print the document.

                pd.Print()

            Finally

                streamToPrint.Close()

            End Try

        Catch ex As Exception

            MessageBox.Show(ex.Message)

        End Try

    End Sub 'Printing   

     

     

    Friday, March 9, 2007 5:02 AM
  • Hello,
    I did not perhaps understand:
    - but what does pd_printpage in this case?
    The problem is that Windows True Type fonts does not work on the printer side when
    accessing special functions. In this case we must print with font 'Control' the letter 'A'
    that causes the cash drawer to open.

    Best regards,
    Seppo

    Friday, March 9, 2007 8:33 AM