• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 882
  • Last Modified:

PRINT TEXT on thermal printer on parallel port(LPT1)

Hi,
I have tried to print a text file through an asp page
for example, the text to print:

********************************
Package Details
*********************************
Item No:1
Product ID:
Sales Order ID:2542122

I want to print this on a thermal printer how do i do that?
i used the following code but it doesnt do anything,i put the text in a .txt file

Private Sub PrintFile(ByVal FileName As String)
        Dim si As New ProcessStartInfo
        With si
            .FileName = System.Environment.GetEnvironmentVariable("COMSPEC")
            .Arguments = String.Format("/C print /D:LPT1", FileName)
            .UseShellExecute = False
            .CreateNoWindow = True
        End With
        Process.Start(si)
        si = Nothing
 End Sub
0
calorisplanitia
Asked:
calorisplanitia
  • 5
  • 4
1 Solution
 
PockyMasterCommented:
IIS will probably not allow you to access the shell, without proper authentication
0
 
PockyMasterCommented:
But you can always just put the files somewhere, and let another process (not ASP) but e.g. Forms app monitor a folder and pick up the files for you.
0
 
calorisplanitiaAuthor Commented:
hi
I need to know the syntax for thermal printer e.g. this text prints:

N
OD10
q812
Q1218,24
D15
ZB
LO0,147,800,4
LO0,401,800,4
LO0,746,800,4
A35,9,0,2,1,1,N,"From:"
A35,28,0,2,1,1,N,"Microsoft"
A35,48,0,2,1,1,N,""
A35,68,0,2,1,1,N," MORGAN PARK"

Above text when sent to a thermal printer using the code PrintFile function, prints :
From:
Microsoft

Morgan Park

so i need to know if any body know the syntax as plain text file doesnt print
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
PockyMasterCommented:
You are using a Zebra printer right?
0
 
calorisplanitiaAuthor Commented:
yes
0
 
PockyMasterCommented:
If you are looking for a protocol specification, didn't you get one with your printer? or otherwise have a look at the zebra website
0
 
calorisplanitiaAuthor Commented:
ok thanks,
but i cant find any on their website
0
 
calorisplanitiaAuthor Commented:
Hi Pocky Master
that link helped
but iam struck with the printfile function isnt doing anything, i have created an application in vb.net which monitors a folder & prints it. But the function isnt printing anything, even a test file.
however it prints fine through the DOS prompt
Dont know what to do  i am struck again.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now