Print text file

  • Thread starter Thread starter Genaro Sanchez
  • Start date Start date
G

Genaro Sanchez

Hi, how can I print text files from the PocketPC?
I want the text file to be printed to a printer connected to a print server.
Also i want to know how to do this in .NET:
For example, i have this VB6 code:
Open sFileC For Output As #1
Print #1, Chr$(&H1B); "c4"; Chr$(2)
Print #1, "Date and time: " & Format(Date, "dd/MM/yyyy") & " " & Time
....
....
....
Print #1, Chr$(&H1D); "V"; Chr$(66); Chr$(0)
Close #1

When i try to do it in .NET, with StreamWriter, for example:
Dim objStreamWriter As StreamWriter
objStreamWriter = New StreamWriter(StartupPath & "\" & dNoComanda & "C.txt")

objStreamWriter.WriteLine(Chr$(&H1D); "V"; Chr$(66); Chr$(0))

objStreamWriter.Close()

There is an error. How can I do the same code in .NET.?

Thanks a lot.
 
Ok, thanks.
Nino Benvenuti said:
Genaro,

First, you need to understand that there is no printing capability in
Pocket
PC (or in .NET CF, for that matter).

Check out the archives for some discussions on the topic of network
printing:
http://groups.google.com/group/micr...framework&q=compactframework+network+printing

If you end up going the third-party component route, I've had good
experiences with Field Software's NET CF SDK[1].

hth,
Nino

[1]http://www.fieldsoftware.com/PrinterCE_NetCF.htm

--
Nino Benvenuti
Device Application Development MVP
http://nino.net/blog


Genaro Sanchez said:
Hi, how can I print text files from the PocketPC?
I want the text file to be printed to a printer connected to a print
server.
Also i want to know how to do this in .NET:
For example, i have this VB6 code:
Open sFileC For Output As #1
Print #1, Chr$(&H1B); "c4"; Chr$(2)
Print #1, "Date and time: " & Format(Date, "dd/MM/yyyy") & " " & Time
....
....
....
Print #1, Chr$(&H1D); "V"; Chr$(66); Chr$(0)
Close #1

When i try to do it in .NET, with StreamWriter, for example:
Dim objStreamWriter As StreamWriter
objStreamWriter = New StreamWriter(StartupPath & "\" & dNoComanda &
"C.txt")

objStreamWriter.WriteLine(Chr$(&H1D); "V"; Chr$(66); Chr$(0))

objStreamWriter.Close()

There is an error. How can I do the same code in .NET.?

Thanks a lot.
 
Back
Top