.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> .NET Framework >> Post New QuestionBookmark and Share Subscribe to Forum

Printing from pocket pc application

Posted By: Rashmita     Posted Date: July 18, 2010    Points:2   Category :.NET Framework
I have developed a pocket pc application and I need to print from this application. I am using PrinterCE.netCF for printing purpose .The printer i am using is TIII Bluetooth Printer. But while printing, the format is unknown. Is it that the PrinterCE.netCF doesn't support this printer? Please help!!


Responses
Author: Syed Shakeer Hussain          Accepted Answer   
Posted Date: July 18, 2010     Points: 10   

Hi Rashmita,
I had done the same work with 'MZ220' Printer using Windows Mobile appplication

first you have to On 'BlueTooth' and set COM port in your mobile.

if the COM port connection is sucessfullly connected,use that COM port name in Coding as
SerialPort sp=new SerialPort();
sp.PortName="COM6";


Author: Rashmita             
Posted Date: July 19, 2010     Points: 5   

Hi Syed,

Thanks for your reply. But after adding the above code also, the printed text are in unreadable format as before. The text are being printed but in unreadable format as before.

Thanks.

Author: Syed Shakeer Hussain             
Posted Date: July 19, 2010     Points: 5   

Hi Rashmita,

Send me the code what you had written

Author: Rashmita             
Posted Date: July 19, 2010     Points: 5   

Dear Syed,

Attached please find the code. I am using button2 to print.

Regards,

Rashmita

Download Attachment

Author: Syed Shakeer Hussain             
Posted Date: July 19, 2010     Points: 5   

Hi Rashmita,
The code is very easy.First use the below code in your Print Button.If it is working then write your code like font size ,font color etc..


        
SerialPort p = new SerialPort();
p.PortName = "COM7";

p.BaudRate = 9600;
p.DataBits = 8;
StringBuilder DataString = new StringBuilder();


DataString.Append("Shakeer hussain\r");
DataString.Append("PRINT Over\r");
DataString.Append("------------------------------\r\n");



System.Text.ASCIIEncoding ppp = new ASCIIEncoding();
byte[] buff = ppp.GetBytes(DataString.ToString());
p.WriteBufferSize = buff.Length;
p.Open();

p.WriteLine(DataString.ToString());
p.Close();


In the above code COM7 is my working portName.
so you have to write your working Port name as p.PortName="yourPortName"

If you have any dought in COM Port.you can ask...



Author: Rashmita             
Posted Date: July 19, 2010     Points: 5   

Dear Syed,

Thank you so much for your help. Its working now. But how shall i set the fontsize, fontname etc.
Thank you so much once again!!

Regards,

Rashmita

Author: Syed Shakeer Hussain             
Posted Date: July 19, 2010     Points: 5   

Hi Rashmita,
If my post is helpful mark it as answer.It can helpfull to others also..

I need your help.currently i am struggling to get the data from a serial Port to PDA.
if you know how to communicate serial port with PDA plz let me know.since from last 3 days i struggling to get data from serial port to PDA.

my problem is 'I have an Electronic wieghing mechine '.I need to communicate with this Elctronic Weighing mechine and read the weight(eg:10 kg) to PDA device.

But data is not reading.
If you know plz help it...

you can send email to my address syedshakeer@rediffmail.com

Author: Rashmita             
Posted Date: July 20, 2010     Points: 5   

Dear Syed,

Sorry I don't have an idea regarding to get the data from a serial port to PDA.

In my application, the device (Mobile phone) retreives the data from My Laptop that is stored in SQL Server.

I am not using ports to read data.

Kindly help if you can send me the code regarding adjustment of the fontsize, fontname etc.

Regards,

Rashmita

Author: Syed Shakeer Hussain             
Posted Date: August 05, 2010     Points: 5   

Hi Rashmita,
You know how to give print in Bold letters through coding...
if you know plz inform me...



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend