Bluetooth printing

  • Thread starter Thread starter GT
  • Start date Start date
G

GT

Hi All,

I have a bluetooth printer and a winCE4.2 PDA with bluetooth.
I'm looking for a .NET (preferably C#) code sample of printing
through bluetooth.
Does anyone come across one?
I'll be grateful for any help.

Thanks,

G
 
Thanks for the suggestion,

Unfortunately I won't be able t use any non-open source solutions for
the problem.
Since I'll need to wire it up myself, what I'm looking for is
anything to start with.


G
 
Then you'll have to find a reference to the printer control language that
the printer you want to target uses and send the right stuff out the
appropriate port. Get the printer's manual. That will sometimes have the
language information. If it's PCL of some version, you might find that
documented at HP or on the Web.

Paul T.
 
You could use the OpenNETCF.Net.Bluetooth library, still in development but
has enough functionality for you to achieve printing to a device.
First see this post for the most recent code drop and sample application:-
http://blog.opennetcf.org/pfoot/#ac9d82a04-e68b-4b39-8afe-4aa2e00acb46
There will be another update shortly which I'll also announce on the blog.

You'll need to do the following:-
Use BluetoothClient to discover devices to identify your printer
Get the BluetoothAddress for your chosen device - the DeviceID property of
the chosen device returned by DiscoverDevices
using BluetoothClient establish an outgoing connection to the device using
the BluetoothService.SerialPortService service Guid
Use GetStream to return the NetworkStream for the connection
Read and Write data from/to the stream
Close your BluetoothClient when you've finished.

As to what commands to send to your printer, that will depend somewhat on
the hardware and the documentation for your printer should help somewhat.

Peter
 
Back
Top