Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_components thread: AW: RE: AW: RE: Using ASP to print chinese chara cter


Message #1 by "Daniel Kohler" <kohler@a...> on Wed, 2 Oct 2002 19:31:43 +0200
Hi

What language is your server running? Do you have installed
chinese language support on the server or a chinese font in
True Type ?

Dany

-----Urspr=C3=BCngliche Nachricht-----
Von: Teng-Fong SEAK [mailto:tfseak@f...]
Gesendet: Mittwoch, 2. Oktober 2002 14:47
An: ASP components
Betreff: [asp_components] RE: AW: RE: Using ASP to print chinese chara
cter


> The printer is installed at the server side. What I'm doing
> is that I am
> working on a wireless ordering system using a Pocket PC. When
> the Pocket
> PC
> Click "order", the server is suppose to print a customer's
> order via the
>
> Kitchen printer.

	Since you use Pocket PC, everything is in Unicode, right ?

> My sample codes are below:
>
> <%@Language=3DVBScript%>
> <!-- #include file=3D"General.inc" -->
> <%
> 	session.CodePage =3D 65001

	This is useful only for the client side.  But since you're printing
on server-side, that I've never done before, make sure there's no side
effect from this instruction to your printing.

> 	Dim strSQL
> 	Set objP =3D Server.CreateObject("aspPrint.ServerPrint")
> 	objP.setPrinter =3D "EPSON TM-T88II Partial cut"
> 	objP.setFont =3D "Lucida Sans Unicode"

	There's "Arial Unicode MS", and this font seems more likely to be
Unicode than "Lucida Sans Unicode".  In my Win2k, "Lucida Sans Unicode" 
has
a size of 317kB while "Arial Unicode MS" has a size of 23566kB.

> 	objP.setFontSize =3D 9
> 	objP.setFontBold =3D True
> 	objP.setFontItalic =3D False
> 	objP.setFontUnderline =3D True
> =09
> 	OpenConnection("HRSPOS")
> 	strSQL=3D"SELECT MenuName_Chinese FROM MenuHdr1"
> 	set adorec=3Dadocn.execute(strSQL)

	A question of curiosity, where does adocn come from?

> 	do while not adorec.EOF
> 		objP.doPrint(adorec("MenuName_Chinese"))
> 		adorec.MoveNext
> 	loop

	If nothing works, you have to debug it step by step.  I've got two
hints for you:
1) print a string of Chinese instead from  adorec("MenuName_Chinese").  
That
is,
objP.doPrint("Your string with some Chinese characters")
2) dump  adorec("MenuName_Chinese")  to a file and see in which encoding
(Unicode, Big5 or GB) the text is in.  The problem with VBScript is that
it's not clear which encoding its string is using.  This isn't the case 
with
JScript (ECMA Script) in which string is in Unicode.  There's thus no
ambiguity in JScript.

	Good luck

> 	CloseConnection
> 	objP.endDocument
> %>
>
> I have already set the printer to print true type font as graphics,
> But the result is still the same.


%%email.unsub%%



Message #2 by "weixian" <weixian@a...> on Thu, 3 Oct 2002 10:14:51 +0800
Hey Guys,

Thanks for all the help. After installing the East Asian Language
Pack into the server, I am able to print chinese now. Cheers!!!

All along I'm using NJStar Chinese to enable chinese support on the
Server. However, the software doesn't seems to be able to recognise
Chinese characters when I tried to do direct printing using ASP.

\(^0^)/

Lau Wee Shian

-----Original Message-----
From: Daniel Kohler [mailto:kohler@a...]
Sent: Thursday, October 03, 2002 1:32 AM
To: ASP components
Subject: [asp_components] AW: RE: AW: RE: Using ASP to print chinese 
chara cter

Hi

What language is your server running? Do you have installed
chinese language support on the server or a chinese font in
True Type ?

Dany

-----Urspr=C3=BCngliche Nachricht-----
Von: Teng-Fong SEAK [mailto:tfseak@f...]
Gesendet: Mittwoch, 2. Oktober 2002 14:47
An: ASP components
Betreff: [asp_components] RE: AW: RE: Using ASP to print chinese chara
cter


> The printer is installed at the server side. What I'm doing
> is that I am
> working on a wireless ordering system using a Pocket PC. When
> the Pocket
> PC
> Click "order", the server is suppose to print a customer's
> order via the
>
> Kitchen printer.

	Since you use Pocket PC, everything is in Unicode, right ?

> My sample codes are below:
>
> <%@Language=3DVBScript%>
> <!-- #include file=3D"General.inc" -->
> <%
> 	session.CodePage =3D 65001

	This is useful only for the client side.  But since you're printing
on server-side, that I've never done before, make sure there's no side
effect from this instruction to your printing.

> 	Dim strSQL
> 	Set objP =3D Server.CreateObject("aspPrint.ServerPrint")
> 	objP.setPrinter =3D "EPSON TM-T88II Partial cut"
> 	objP.setFont =3D "Lucida Sans Unicode"

	There's "Arial Unicode MS", and this font seems more likely to be
Unicode than "Lucida Sans Unicode".  In my Win2k, "Lucida Sans Unicode" 
has
a size of 317kB while "Arial Unicode MS" has a size of 23566kB.

> 	objP.setFontSize =3D 9
> 	objP.setFontBold =3D True
> 	objP.setFontItalic =3D False
> 	objP.setFontUnderline =3D True
> =09
> 	OpenConnection("HRSPOS")
> 	strSQL=3D"SELECT MenuName_Chinese FROM MenuHdr1"
> 	set adorec=3Dadocn.execute(strSQL)

	A question of curiosity, where does adocn come from?

> 	do while not adorec.EOF
> 		objP.doPrint(adorec("MenuName_Chinese"))
> 		adorec.MoveNext
> 	loop

	If nothing works, you have to debug it step by step.  I've got two
hints for you:
1) print a string of Chinese instead from  adorec("MenuName_Chinese").  
That
is,
objP.doPrint("Your string with some Chinese characters")
2) dump  adorec("MenuName_Chinese")  to a file and see in which encoding
(Unicode, Big5 or GB) the text is in.  The problem with VBScript is that
it's not clear which encoding its string is using.  This isn't the case 
with
JScript (ECMA Script) in which string is in Unicode.  There's thus no
ambiguity in JScript.

	Good luck

> 	CloseConnection
> 	objP.endDocument
> %>
>
> I have already set the printer to print true type font as graphics,
> But the result is still the same.


To unsubscribe send a blank email to %%email.unsub%%





%%email.unsub%%



  Return to Index