How can we Send Print at our Local Printer or Network Printer thru Pocket PC

  • Thread starter Thread starter zeeshan
  • Start date Start date
Z

zeeshan

I have seen some article about PrinterCE, but that printers are
directly attached with Pocket PC and those Printer has support of
Pocket PC, but I m interested to send print at my local PC Printer or
any printer on Network.

Thanks
Zeeshan
 
Just use the FileStream and write the text into the stream. Something like
that:

FileStream fs;
fs = new FileStream(@"\\Server\HP5si_PCL", FileMode.Create);

string printStr = "Hello network printer";

byte[] data = System.Text.Encoding.UTF8.GetBytes(printStr);

fs.Write(data, 0, data.Length);

//Put <FF> at the end of the document
byte[] byteFF = new byte[] { FF };
fs.Write(byteFF, 0, 1);
 
Note that PrinterCE.NetCF SDK does support printing to shared network
printers via WiFi or wired network connections from your device, as well
as IP network, Bluetooth, Infrared and serial:

Network printing info:
http://www.fieldsoftware.com/NetworkOptions.htm

PrinterCE.NetCF SDK Home:
http://www.fieldsoftware.com/PrinterCE_NetCF.htm

Download free 60-day evaluation:
http://www.fieldsoftware.com/PrinterCE_NetCF_download.htm

Supported printers:
http://www.fieldsoftware.com/PrintersSupported.htm


Also find example code, online documentation and much more.


Tim
 
Thanks for your message it worked. Now I m trying to send Image on
Printer. I tried to convert .bmp file in the Array of Byte but still no
luck, and i m not sure, after converting any image into byte array and
send it to the filestream u mentioned, will work or not.

Regards,
Zeeshan
 
Are you sure that a Windows bitmap is going to be printable by this printer?
You really need to be using PrinterCE or, if you absolutely must waste your
time, get the specs for the printer language that your target printer uses
and figure out what you should be sending for the bitmap case. We can't
write this code for you...

Paul T.
 
Back
Top