Bluetooth print and Special characters

Bluetooth print and Special characters

Postby Richard Chidiak » Wed Feb 14, 2007 3:22 pm

Antonio

My fwppc app writes on bluetooth printer. This works OK on HP 460 BT, the print goes OK but the special characters do not show.
Printing to a text file and then manually printing the text file is OK.

I wouls like to avoid this solution and have direct print with special charcaters. Any idea ?
Has anyone succeeded printing special characters directly on bt from fwppc ?

Thanks for the help

Richard

Here is a small sample of the code

Sendblue( MemoRead(cfile)) // oemtoansi(cfile) does not do any change


STATIC function SendText( hOut, cText )
local n
FWRITE( HOUT, CTEXT + CRLF )
return nil

STATIC FUNCTION SENDBLUE(ctext)
LOCAL i, hOut

DPTCOM := "COM" + STR(PKID->COMIMPRI,1) + ":"
// DPTCOM := "COM6:"

hOut := CreateFile( DPTCOM,GENERIC_REWRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL )
IF hOut==-1
MsgStop("Port Impression non trouvé, Impression Impossible")
ELSE
FOR i = 1 TO Len( cText )
WriteByte( hOut, Asc(SubStr( cText, i, 1 ) ) )
NEXT
CloseHandle( hOut )
ENDIF
return nil
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Postby Antonio Linares » Thu Feb 15, 2007 6:17 pm

Richard,

What asc() values those special characters have ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42071
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Richard Chidiak » Thu Feb 15, 2007 7:57 pm

Antonio

They are standard accented french characters (like in spanish)

i do not know the ascii character but i can display them it if necessary

ex: "Désignation" The (é) is one of them.

What is strange, is that my program writes first to an ascii file (txt) and then prints from the ascii file.

The ascii file is perfect.

If i print directly the ascii file to the printer (without fwppc), the printout is perfect !

I am puzzled. No one has ever tried to print local characters (spanish, portuguese,..etc) via bluetooth ?

I can do all necessary tests if needed.

Thanks for your help.


Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Postby Antonio Linares » Thu Feb 15, 2007 9:06 pm

Richard,

> i do not know the ascii character but i can display them it if necessary

Please place a MsgInfo() to check their asc() values, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42071
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Richard Chidiak » Thu Feb 15, 2007 9:17 pm

Antonio

first one is 233

Do you need them all ? :x

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Postby Antonio Linares » Thu Feb 15, 2007 9:34 pm

Richard,

Just two more, please
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42071
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Richard Chidiak » Thu Feb 15, 2007 9:37 pm

232

224
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Postby Richard Chidiak » Thu Feb 15, 2007 9:41 pm

231
249
176
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Postby Antonio Linares » Thu Feb 15, 2007 9:43 pm

Richard,

Characters with ascii over 128 are printing right ? I wonder if it is a sign issue
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42071
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Richard Chidiak » Thu Feb 15, 2007 9:47 pm

Antonio

I do not have the printer here at home but at the office.

I can check all ascii chars tomorrow early morning and report back.

If you need any more testing, drop me a line

Regards

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Postby Richard Chidiak » Fri Feb 16, 2007 8:51 am

Antonio

Confirmed, it is a sign issue

Ascii codes up to 127 are printed correct not the others.

I sent to your private email a pdf showing a print out of all ascii codes.

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Postby Antonio Linares » Fri Feb 16, 2007 9:08 am

Richard,

Please test this function and place a #define WriteByte _WriteByte in your app:
Code: Select all  Expand view
HB_FUNC( _WRITEBYTE ) // hComm, nChar --> lOk
{
   DWORD cBytes;
   unsigned char ch = ( unsigned char ) hb_parnl( 2 );
   
   hb_retl( ( BOOL ) WriteFile( ( void * ) hb_parnl( 1 ), &ch, 1, &cBytes, NULL ) );
}   
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42071
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Richard Chidiak » Fri Feb 16, 2007 9:47 am

Antonio

Same result


Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Postby Antonio Linares » Sat Feb 17, 2007 7:53 am

Richard,

We are searching info for WriteFile() use to manage unsigned chars
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42071
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Richard Chidiak » Sat Feb 17, 2007 8:01 am

Antonio

No problem

I have the printer available all week end if you need some testing.

Let me know.

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Next

Return to FiveWin for Pocket PC

Who is online

Users browsing this forum: No registered users and 8 guests