Printing to a DYmo Label Printer

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

    #1

    Printing to a DYmo Label Printer

    Hi,
    I'm trying to print barcodes to the Dymo LabelWriter printer. Put everytime
    I send a job to the label printer it just outputs an empty label. If I change
    the default printer back to the standard printer(HP LaserJet), it prints
    fine. Has anyone worked with Label printers like this. Here is the code I'm
    using:
    Private Sub cmdPrint_Click( ByVal sender As System.Object, ByVal e As
    System.EventArg s) Handles cmdPrint.Click
    try
    Dim BarCode as New clsBarCode
    Dim TextToPrint as String
    VariableToPrint = BarCode.Code39( txtPatientID.Te xt )
    barcode.PrintBa rCode("Free 3 of 9 Extended", VariableToPrint , 12)
    exit sub
    Dim PrintDoc As New PrintDocument()
    PrintFont = New Font("Free 3 of 9 Extended", 12) 'IDAutomationHC 39M", 12)
    AddHandler PrintDoc.PrintP age, AddressOf Me.PrintDoPrint Page
    PrintDoc.Print( )
    Catch ex As Exception

    End Try
    End Sub

    Private sub PrintDoPrintPag e(sender as Object, ev as
    System.Drawing. Printing.PrintP ageEventArgs)
    try
    Dim linesPerPage As Single = 0 'Number of lines (bar codes) that you will be
    able to fit on the page
    Dim yPos As Single = 0 'yPos on the page of the bar code
    Dim leftMargin As Single = ev.MarginBounds .Left 'left margin of bar code
    Dim topMargin As Single = ev.MarginBounds .Top 'top margin of bar code
    Dim line As String = Nothing 'String that font will be applied to and
    printed
    linesPerPage = ev.MarginBounds .Height / PrintFont.GetHe ight(ev.Graphic s)
    yPos = 10
    line = VariableToPrint
    ev.Graphics.Dra wString(line, PrintFont, Brushes.Black, leftMargin, yPos, New
    StringFormat())

    Catch ex As Exception

    End Try
    End Sub

    Thank you for any help that you may have.
    Michael
  • Michael

    #2
    RE: Printing to a DYmo Label Printer

    Hi Again, I have the barcode going to the label printer now, but I also have
    one issue left. For the barcode I'm using a Barcode Font, so after the
    Barcode is printed I would like to also have text (Arial font) on the same
    label. What is the best way to handle two different fonts on the same label.
    Thanks again for any advise.
    Michael


    "Michael" wrote:
    [color=blue]
    > Hi,
    > I'm trying to print barcodes to the Dymo LabelWriter printer. Put everytime
    > I send a job to the label printer it just outputs an empty label. If I change
    > the default printer back to the standard printer(HP LaserJet), it prints
    > fine. Has anyone worked with Label printers like this. Here is the code I'm
    > using:
    > Private Sub cmdPrint_Click( ByVal sender As System.Object, ByVal e As
    > System.EventArg s) Handles cmdPrint.Click
    > try
    > Dim BarCode as New clsBarCode
    > Dim TextToPrint as String
    > VariableToPrint = BarCode.Code39( txtPatientID.Te xt )
    > barcode.PrintBa rCode("Free 3 of 9 Extended", VariableToPrint , 12)
    > exit sub
    > Dim PrintDoc As New PrintDocument()
    > PrintFont = New Font("Free 3 of 9 Extended", 12) 'IDAutomationHC 39M", 12)
    > AddHandler PrintDoc.PrintP age, AddressOf Me.PrintDoPrint Page
    > PrintDoc.Print( )
    > Catch ex As Exception
    >
    > End Try
    > End Sub
    >
    > Private sub PrintDoPrintPag e(sender as Object, ev as
    > System.Drawing. Printing.PrintP ageEventArgs)
    > try
    > Dim linesPerPage As Single = 0 'Number of lines (bar codes) that you will be
    > able to fit on the page
    > Dim yPos As Single = 0 'yPos on the page of the bar code
    > Dim leftMargin As Single = ev.MarginBounds .Left 'left margin of bar code
    > Dim topMargin As Single = ev.MarginBounds .Top 'top margin of bar code
    > Dim line As String = Nothing 'String that font will be applied to and
    > printed
    > linesPerPage = ev.MarginBounds .Height / PrintFont.GetHe ight(ev.Graphic s)
    > yPos = 10
    > line = VariableToPrint
    > ev.Graphics.Dra wString(line, PrintFont, Brushes.Black, leftMargin, yPos, New
    > StringFormat())
    >
    > Catch ex As Exception
    >
    > End Try
    > End Sub
    >
    > Thank you for any help that you may have.
    > Michael[/color]

    Comment

    • dblock

      #3
      Re: Printing to a Dymo Label Printer

      Have you considered using DYMO's free SDK for the LabelWriter? I work
      for DYMO, and when I see people struggling like this, it hurts. Our SDK
      uses ActiveX, works with VB.Net (as well as lots of other apps, with
      samples), and makes this kind of thing trivial. You can use the
      high-level interface to open an exisitng label Template, modify the
      barcode data, and print the label. Three commands, and you are done. If
      you later want to change the position of the barcode text, or change
      from Code39 to Code 128 (for example), then it's a matter of opening
      the template with the DYMO Label Software application, making the
      edits, and saving it back. From then on, your app uses the modified
      template. No fonts, no applicaiton code changes, or anything. Templates
      can contain barcodes, text, graphics and more, and the ActiveX control
      takes care of selecting the paper size, shrinking the text to fit, etc.
      Try it. You'll like it.

      Michael wrote:[color=blue]
      > Hi Again, I have the barcode going to the label printer now, but I also have
      > one issue left. For the barcode I'm using a Barcode Font, so after the
      > Barcode is printed I would like to also have text (Arial font) on the same
      > label. What is the best way to handle two different fonts on the same label.
      > Thanks again for any advise.
      > Michael
      >
      >
      > "Michael" wrote:
      >[color=green]
      > > Hi,
      > > I'm trying to print barcodes to the Dymo LabelWriter printer. Put everytime
      > > I send a job to the label printer it just outputs an empty label. If I change
      > > the default printer back to the standard printer(HP LaserJet), it prints
      > > fine. Has anyone worked with Label printers like this. Here is the code I'm
      > > using:
      > > Private Sub cmdPrint_Click( ByVal sender As System.Object, ByVal e As
      > > System.EventArg s) Handles cmdPrint.Click
      > > try
      > > Dim BarCode as New clsBarCode
      > > Dim TextToPrint as String
      > > VariableToPrint = BarCode.Code39( txtPatientID.Te xt )
      > > barcode.PrintBa rCode("Free 3 of 9 Extended", VariableToPrint , 12)
      > > exit sub
      > > Dim PrintDoc As New PrintDocument()
      > > PrintFont = New Font("Free 3 of 9 Extended", 12) 'IDAutomationHC 39M", 12)
      > > AddHandler PrintDoc.PrintP age, AddressOf Me.PrintDoPrint Page
      > > PrintDoc.Print( )
      > > Catch ex As Exception
      > >
      > > End Try
      > > End Sub
      > >
      > > Private sub PrintDoPrintPag e(sender as Object, ev as
      > > System.Drawing. Printing.PrintP ageEventArgs)
      > > try
      > > Dim linesPerPage As Single = 0 'Number of lines (bar codes) that you will be
      > > able to fit on the page
      > > Dim yPos As Single = 0 'yPos on the page of the bar code
      > > Dim leftMargin As Single = ev.MarginBounds .Left 'left margin of bar code
      > > Dim topMargin As Single = ev.MarginBounds .Top 'top margin of bar code
      > > Dim line As String = Nothing 'String that font will be applied to and
      > > printed
      > > linesPerPage = ev.MarginBounds .Height / PrintFont.GetHe ight(ev.Graphic s)
      > > yPos = 10
      > > line = VariableToPrint
      > > ev.Graphics.Dra wString(line, PrintFont, Brushes.Black, leftMargin, yPos, New
      > > StringFormat())
      > >
      > > Catch ex As Exception
      > >
      > > End Try
      > > End Sub
      > >
      > > Thank you for any help that you may have.
      > > Michael[/color][/color]

      Comment

      • Paul Bromley

        #4
        Re: Printing to a Dymo Label Printer

        Has anyone been able to use the dll recommended by Seiko for the Smart Label
        Printer 100?? I have tried to utilise this with Visual Basic 6 but failed
        dismally before I could even think of using it with VB.NET. Any suggestions,
        or do I just utilise the Seiko as a printer on the system?

        Paul Bromley



        "dblock" <dlblock@comcas t.net> wrote in message
        news:1128465618 .311041.93220@g 43g2000cwa.goog legroups.com...[color=blue]
        > Have you considered using DYMO's free SDK for the LabelWriter? I work
        > for DYMO, and when I see people struggling like this, it hurts. Our SDK
        > uses ActiveX, works with VB.Net (as well as lots of other apps, with
        > samples), and makes this kind of thing trivial. You can use the
        > high-level interface to open an exisitng label Template, modify the
        > barcode data, and print the label. Three commands, and you are done. If
        > you later want to change the position of the barcode text, or change
        > from Code39 to Code 128 (for example), then it's a matter of opening
        > the template with the DYMO Label Software application, making the
        > edits, and saving it back. From then on, your app uses the modified
        > template. No fonts, no applicaiton code changes, or anything. Templates
        > can contain barcodes, text, graphics and more, and the ActiveX control
        > takes care of selecting the paper size, shrinking the text to fit, etc.
        > Try it. You'll like it.
        >
        > Michael wrote:[color=green]
        > > Hi Again, I have the barcode going to the label printer now, but I also[/color][/color]
        have[color=blue][color=green]
        > > one issue left. For the barcode I'm using a Barcode Font, so after the
        > > Barcode is printed I would like to also have text (Arial font) on the[/color][/color]
        same[color=blue][color=green]
        > > label. What is the best way to handle two different fonts on the same[/color][/color]
        label.[color=blue][color=green]
        > > Thanks again for any advise.
        > > Michael
        > >
        > >
        > > "Michael" wrote:
        > >[color=darkred]
        > > > Hi,
        > > > I'm trying to print barcodes to the Dymo LabelWriter printer. Put[/color][/color][/color]
        everytime[color=blue][color=green][color=darkred]
        > > > I send a job to the label printer it just outputs an empty label. If I[/color][/color][/color]
        change[color=blue][color=green][color=darkred]
        > > > the default printer back to the standard printer(HP LaserJet), it[/color][/color][/color]
        prints[color=blue][color=green][color=darkred]
        > > > fine. Has anyone worked with Label printers like this. Here is the[/color][/color][/color]
        code I'm[color=blue][color=green][color=darkred]
        > > > using:
        > > > Private Sub cmdPrint_Click( ByVal sender As System.Object, ByVal e As
        > > > System.EventArg s) Handles cmdPrint.Click
        > > > try
        > > > Dim BarCode as New clsBarCode
        > > > Dim TextToPrint as String
        > > > VariableToPrint = BarCode.Code39( txtPatientID.Te xt )
        > > > barcode.PrintBa rCode("Free 3 of 9 Extended", VariableToPrint , 12)
        > > > exit sub
        > > > Dim PrintDoc As New PrintDocument()
        > > > PrintFont = New Font("Free 3 of 9 Extended", 12) 'IDAutomationHC 39M",[/color][/color][/color]
        12)[color=blue][color=green][color=darkred]
        > > > AddHandler PrintDoc.PrintP age, AddressOf Me.PrintDoPrint Page
        > > > PrintDoc.Print( )
        > > > Catch ex As Exception
        > > >
        > > > End Try
        > > > End Sub
        > > >
        > > > Private sub PrintDoPrintPag e(sender as Object, ev as
        > > > System.Drawing. Printing.PrintP ageEventArgs)
        > > > try
        > > > Dim linesPerPage As Single = 0 'Number of lines (bar codes) that you[/color][/color][/color]
        will be[color=blue][color=green][color=darkred]
        > > > able to fit on the page
        > > > Dim yPos As Single = 0 'yPos on the page of the bar code
        > > > Dim leftMargin As Single = ev.MarginBounds .Left 'left margin of bar[/color][/color][/color]
        code[color=blue][color=green][color=darkred]
        > > > Dim topMargin As Single = ev.MarginBounds .Top 'top margin of bar[/color][/color][/color]
        code[color=blue][color=green][color=darkred]
        > > > Dim line As String = Nothing 'String that font will be applied[/color][/color][/color]
        to and[color=blue][color=green][color=darkred]
        > > > printed
        > > > linesPerPage = ev.MarginBounds .Height /[/color][/color][/color]
        PrintFont.GetHe ight(ev.Graphic s)[color=blue][color=green][color=darkred]
        > > > yPos = 10
        > > > line = VariableToPrint
        > > > ev.Graphics.Dra wString(line, PrintFont, Brushes.Black, leftMargin,[/color][/color][/color]
        yPos, New[color=blue][color=green][color=darkred]
        > > > StringFormat())
        > > >
        > > > Catch ex As Exception
        > > >
        > > > End Try
        > > > End Sub
        > > >
        > > > Thank you for any help that you may have.
        > > > Michael[/color][/color]
        >[/color]


        Comment

        Working...