By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,730 Members | 1,559 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,730 IT Pros & Developers. It's quick & easy.

Printing to a DYmo Label Printer

P: n/a
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.EventArgs) Handles cmdPrint.Click
try
Dim BarCode as New clsBarCode
Dim TextToPrint as String
VariableToPrint = BarCode.Code39(txtPatientID.Text )
barcode.PrintBarCode("Free 3 of 9 Extended", VariableToPrint, 12)
exit sub
Dim PrintDoc As New PrintDocument()
PrintFont = New Font("Free 3 of 9 Extended", 12) 'IDAutomationHC39M", 12)
AddHandler PrintDoc.PrintPage, AddressOf Me.PrintDoPrintPage
PrintDoc.Print()
Catch ex As Exception

End Try
End Sub

Private sub PrintDoPrintPage(sender as Object, ev as
System.Drawing.Printing.PrintPageEventArgs)
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.GetHeight(ev.Graphics)
yPos = 10
line = VariableToPrint
ev.Graphics.DrawString(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
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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:
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.EventArgs) Handles cmdPrint.Click
try
Dim BarCode as New clsBarCode
Dim TextToPrint as String
VariableToPrint = BarCode.Code39(txtPatientID.Text )
barcode.PrintBarCode("Free 3 of 9 Extended", VariableToPrint, 12)
exit sub
Dim PrintDoc As New PrintDocument()
PrintFont = New Font("Free 3 of 9 Extended", 12) 'IDAutomationHC39M", 12)
AddHandler PrintDoc.PrintPage, AddressOf Me.PrintDoPrintPage
PrintDoc.Print()
Catch ex As Exception

End Try
End Sub

Private sub PrintDoPrintPage(sender as Object, ev as
System.Drawing.Printing.PrintPageEventArgs)
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.GetHeight(ev.Graphics)
yPos = 10
line = VariableToPrint
ev.Graphics.DrawString(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

Nov 21 '05 #2

P: n/a
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:
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:
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.EventArgs) Handles cmdPrint.Click
try
Dim BarCode as New clsBarCode
Dim TextToPrint as String
VariableToPrint = BarCode.Code39(txtPatientID.Text )
barcode.PrintBarCode("Free 3 of 9 Extended", VariableToPrint, 12)
exit sub
Dim PrintDoc As New PrintDocument()
PrintFont = New Font("Free 3 of 9 Extended", 12) 'IDAutomationHC39M", 12)
AddHandler PrintDoc.PrintPage, AddressOf Me.PrintDoPrintPage
PrintDoc.Print()
Catch ex As Exception

End Try
End Sub

Private sub PrintDoPrintPage(sender as Object, ev as
System.Drawing.Printing.PrintPageEventArgs)
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.GetHeight(ev.Graphics)
yPos = 10
line = VariableToPrint
ev.Graphics.DrawString(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


Nov 21 '05 #3

P: n/a
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" <dl*****@comcast.net> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...
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:
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:
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.EventArgs) Handles cmdPrint.Click
try
Dim BarCode as New clsBarCode
Dim TextToPrint as String
VariableToPrint = BarCode.Code39(txtPatientID.Text )
barcode.PrintBarCode("Free 3 of 9 Extended", VariableToPrint, 12)
exit sub
Dim PrintDoc As New PrintDocument()
PrintFont = New Font("Free 3 of 9 Extended", 12) 'IDAutomationHC39M", 12) AddHandler PrintDoc.PrintPage, AddressOf Me.PrintDoPrintPage
PrintDoc.Print()
Catch ex As Exception

End Try
End Sub

Private sub PrintDoPrintPage(sender as Object, ev as
System.Drawing.Printing.PrintPageEventArgs)
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.GetHeight(ev.Graphics) yPos = 10
line = VariableToPrint
ev.Graphics.DrawString(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

Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.