Bluetooth printing

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
 
G

GT

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
 
P

Paul G. Tobey [eMVP]

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.
 
P

Peter Foot [MVP]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top