Bluetooth print and Special characters

User avatar
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Bluetooth print and Special characters

Post by Richard Chidiak »

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
Antonio Linares
Site Admin
Posts: 42511
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 73 times
Contact:

Post by Antonio Linares »

Richard,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Post by Richard Chidiak »

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
Antonio Linares
Site Admin
Posts: 42511
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 73 times
Contact:

Post by Antonio Linares »

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
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Post by Richard Chidiak »

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
Antonio Linares
Site Admin
Posts: 42511
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 73 times
Contact:

Post by Antonio Linares »

Richard,

Just two more, please
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Post by Richard Chidiak »

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
Contact:

Post by Richard Chidiak »

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

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Antonio Linares
Site Admin
Posts: 42511
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 73 times
Contact:

Post by Antonio Linares »

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
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Post by Richard Chidiak »

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
Contact:

Post by Richard Chidiak »

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
Antonio Linares
Site Admin
Posts: 42511
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 73 times
Contact:

Post by Antonio Linares »

Richard,

Please test this function and place a #define WriteByte _WriteByte in your app:

Code: Select all | Expand

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
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Post by Richard Chidiak »

Antonio

Same result


Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Antonio Linares
Site Admin
Posts: 42511
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 73 times
Contact:

Post by Antonio Linares »

Richard,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Post by Richard Chidiak »

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
Post Reply