Bluetooth print and Special characters
- Richard Chidiak
- Posts: 946
- Joined: Thu Oct 06, 2005 7:05 pm
- Location: France
- Contact:
Bluetooth print and Special characters
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
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
- 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:
- Richard Chidiak
- Posts: 946
- Joined: Thu Oct 06, 2005 7:05 pm
- Location: France
- Contact:
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
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
- 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:
- Richard Chidiak
- Posts: 946
- Joined: Thu Oct 06, 2005 7:05 pm
- Location: France
- Contact:
- 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:
- Richard Chidiak
- Posts: 946
- Joined: Thu Oct 06, 2005 7:05 pm
- Location: France
- Contact:
- Richard Chidiak
- Posts: 946
- Joined: Thu Oct 06, 2005 7:05 pm
- Location: France
- Contact:
- 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:
- Richard Chidiak
- Posts: 946
- Joined: Thu Oct 06, 2005 7:05 pm
- Location: France
- Contact:
- Richard Chidiak
- Posts: 946
- Joined: Thu Oct 06, 2005 7:05 pm
- Location: France
- Contact:
- 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:
Richard,
Please test this function and place a #define WriteByte _WriteByte in your app:
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 ) );
}
- Richard Chidiak
- Posts: 946
- Joined: Thu Oct 06, 2005 7:05 pm
- Location: France
- Contact:
- 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:
- Richard Chidiak
- Posts: 946
- Joined: Thu Oct 06, 2005 7:05 pm
- Location: France
- Contact: