Link to home
Start Free TrialLog in
Avatar of calorisplanitia
calorisplanitia

asked on

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
Avatar of PockyMaster
PockyMaster
Flag of Netherlands image

IIS will probably not allow you to access the shell, without proper authentication
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.
Avatar of calorisplanitia
calorisplanitia

ASKER

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
You are using a Zebra printer right?
yes
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
ok thanks,
but i cant find any on their website
ASKER CERTIFIED SOLUTION
Avatar of PockyMaster
PockyMaster
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.