FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Pocket PC Bluetooth print and Special characters
Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
Bluetooth print and Special characters
Posted: Wed Feb 14, 2007 03: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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Bluetooth print and Special characters
Posted: Thu Feb 15, 2007 06:17 PM

Richard,

What asc() values those special characters have ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
Bluetooth print and Special characters
Posted: Thu Feb 15, 2007 07: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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Bluetooth print and Special characters
Posted: Thu Feb 15, 2007 09: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
Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
Bluetooth print and Special characters
Posted: Thu Feb 15, 2007 09: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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Bluetooth print and Special characters
Posted: Thu Feb 15, 2007 09:34 PM

Richard,

Just two more, please

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
Bluetooth print and Special characters
Posted: Thu Feb 15, 2007 09:37 PM

232

224

http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
Bluetooth print and Special characters
Posted: Thu Feb 15, 2007 09:41 PM

231
249
176

http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Bluetooth print and Special characters
Posted: Thu Feb 15, 2007 09: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
Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
Bluetooth print and Special characters
Posted: Thu Feb 15, 2007 09: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
Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
Bluetooth print and Special characters
Posted: Fri Feb 16, 2007 08: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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Bluetooth print and Special characters
Posted: Fri Feb 16, 2007 09:08 AM
Richard,

Please test this function and place a #define WriteByte _WriteByte in your app:
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
Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
Bluetooth print and Special characters
Posted: Fri Feb 16, 2007 09:47 AM

Antonio

Same result

Richard

http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Bluetooth print and Special characters
Posted: Sat Feb 17, 2007 07:53 AM

Richard,

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

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
Bluetooth print and Special characters
Posted: Sat Feb 17, 2007 08: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