473,378 Members | 1,382 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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.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
3 14956
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Murray Elliot | last post by:
Just wondering if anyone has any ideas on how to solve a particular problem. A client wants to print barcode labels from their (web/php based application). The barcode labels are very small, so I'm...
7
by: Ira S | last post by:
I use a DYMO labelwriter with my Access 97 database. I just purchased a new computer and in the report section under page setup/paper size, the new computer keeps changing the size automatically. I...
5
by: Tom | last post by:
I am converting an old application that was printing directly to a specialized printer device (i.e. a special label printer). It was doing this by opening a file with the file path of 'LPT1:' and...
3
by: Mika M | last post by:
Hi all! I have made an application for printing simple barcode labels using PrintDocument object, and it's working fine. Barcode printer that I use is attached to the computer, and this...
3
by: carlor | last post by:
Hi there, Our client has a requirement to print labels from the web site to a local printer. i.e. user logs onto web site and click a print button and the address is printed to a label printer...
2
by: Beginner | last post by:
I have to print a Fedex shipping label on a Zebra(thermal) printer. I initially had the label information in a base64 string which I decoded into a memory stream. Now I need to send this memory...
7
by: BillE | last post by:
I need to print an address label (about .75" x 2.5") to a Dymo LabelWriter from a web form, with the minimum amount of user interaction other than pressing a print button. What is the best way...
1
by: Thorben Grosser | last post by:
Hello newsgroup, I'm finally done with my folder-archiving tool, still there are some flaws. To label the folders, I use a Dymo LabelWriter 400 printer which works great for my purposes. ...
0
by: deepa2Apr | last post by:
Hi, I'm trying to use a Dymo LabelWriter Turbo (Software version 4.1.0.0) on Windows XP, in my C# code. I'm able to detect the printer through my code. However it doesnt print anything. It tries...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.