|
View:
New views
13 Messages
—
Rating Filter:
Alert me
|
|
|
Problem with asian language fontsHi
I have problem regarding display of Asian Language fonts in FOP. 1. I am using Castor Framework to convert my Objects to XML. 2. I am passing this XML and the input XSL to the transformer and flushing out the PDF. In the DB they are sorted as encoded characters, now i am confused where i have to do this conversion into chinese characters. Should this be done by castor framewrok which transforms my objects into XML,should i introduce the encoding here? Or Should i get the characters as encoded string in the XML and convert them into chinese characters while i am printing them as PDF. transformer.setOutputProperty(OutputKeys.ENCODING,"ISO-8859-1"); transformer.transform(source, new StreamResult(outTransform)); I am using arial unicode font for display. Thanks, Rakesh Kumar S **************** CAUTION - Disclaimer ***************** This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS******** End of Disclaimer ********INFOSYS*** --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscribe@... For additional commands, e-mail: fop-users-help@... |
|
|
Re: Problem with asian language fontsRakesh Kumar S wrote:
> Hi > > I have problem regarding display of Asian Language fonts in FOP. > > 1. I am using Castor Framework to convert my Objects to XML. > 2. I am passing this XML and the input XSL to the transformer and flushing out the PDF. > > In the DB they are sorted as encoded characters, now i am confused where i have to do this conversion into chinese characters. > > Should this be done by castor framewrok which transforms my objects into XML,should i introduce the encoding here? > Or > Should i get the characters as encoded string in the XML and convert them into chinese characters while i am printing them as PDF. You need to make sure that every part in your processing chain that does byte to string or vice versa does the conversion using a UTF-8 encoding. > > transformer.setOutputProperty(OutputKeys.ENCODING,"ISO-8859-1"); This won't work as iso-8859-1 doesn't include Chinese Characters only Western Characters. > transformer.transform(source, new StreamResult(outTransform)); > > I am using arial unicode font for display. Regards, Chris <snip/> --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscribe@... For additional commands, e-mail: fop-users-help@... |
|
|
RE: Problem with asian language fontsHi,
Which is the encoding format that will support both asian language and western fonts? Thanks, Rakesh Kumar S ________________________________________ From: Chris Bowditch [bowditch_chris@...] Sent: Tuesday, July 08, 2008 5:12 PM To: fop-users@... Subject: Re: Problem with asian language fonts Rakesh Kumar S wrote: > Hi > > I have problem regarding display of Asian Language fonts in FOP. > > 1. I am using Castor Framework to convert my Objects to XML. > 2. I am passing this XML and the input XSL to the transformer and flushing out the PDF. > > In the DB they are sorted as encoded characters, now i am confused where i have to do this conversion into chinese characters. > > Should this be done by castor framewrok which transforms my objects into XML,should i introduce the encoding here? > Or > Should i get the characters as encoded string in the XML and convert them into chinese characters while i am printing them as PDF. You need to make sure that every part in your processing chain that does byte to string or vice versa does the conversion using a UTF-8 encoding. > > transformer.setOutputProperty(OutputKeys.ENCODING,"ISO-8859-1"); This won't work as iso-8859-1 doesn't include Chinese Characters only Western Characters. > transformer.transform(source, new StreamResult(outTransform)); > > I am using arial unicode font for display. Regards, Chris <snip/> --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscribe@... For additional commands, e-mail: fop-users-help@... **************** CAUTION - Disclaimer ***************** This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS******** End of Disclaimer ********INFOSYS*** --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscribe@... For additional commands, e-mail: fop-users-help@... |
|
|
Re: Problem with asian language fontsRakesh Kumar S a écrit :
> Hi, > > Which is the encoding format that will support both asian language and > western fonts? > > Thanks, > Rakesh Kumar S > > Any Unicode-based encoding will do the job. One of the UTF-16 (Big Endian or Little Endian) is probably your best choice, since UTF-8 is a variable-length encoding that will use 3 bytes or more for Asian characters, while UTF-16 will use 16 bits flat for every character. --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscribe@... For additional commands, e-mail: fop-users-help@... |
|
|
Re: Problem with asian language fontsRakesh Kumar S wrote:
> Hi, > > Which is the encoding format that will support both asian language and > western fonts? UTF-8 <snip/> Chris --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscribe@... For additional commands, e-mail: fop-users-help@... |
|
|
|
|
|
|
|
|
|
|
|
RE: Problem with Asian Language fontsThe XML Structure is like this :
<?xml version="1.0" encoding="UTF-8"?> <candidates> <candidate-data> <candidatename>Raja Raja</candidatename> <addressline1>Raja</addressline1> <addressline2>北方话/北方話</addressline2> <addressline3>北方话/北方話</addressline3> <addressline4>北方话/北方話</addressline4> <addressline5>北方话/北方話</addressline5> <addressline6>北方话/北方話</addressline6> </candidate-data> <candidate-data> <candidatename>Rakesh Rakesh</candidatename> <addressline1>Raja</addressline1> <addressline2>北方话/北方話</addressline2> <addressline3>北方话/北方話</addressline3> <addressline4>北方话/北方話</addressline4> <addressline5>北方话/北方話</addressline5> <addressline6>北方话/北方話</addressline6> </candidate-data> </candidates> Where am i doing the Mistake !!!! ________________________________________ From: Rakesh Kumar S [Rakesh_Kumar06@...] Sent: Wednesday, July 09, 2008 4:34 PM To: fop-users@... Subject: Problem with Asian Language fonts Hi Guys, I have a problem with displaying Asian Language fonts in PDF.Ours is a Java application using hibernate and we have a reporting module where we need to print reports as PDF's. We are using apache FOP for this purpose. Our application allows the users to enter in asian language fonts Japenese, Chinese, Korean languages. Now those languages get stored in the DB. When they are stored in the DB they get converted into encoded values and are saved. While converting into PDF we have two steps: 1. Convert the Object into XML using castor framework. 2. Convert the XML into a PDF using FOP. My problem is that the characters are appearing as encoded text in the PDF also. I am using UTF-8 encoding.I am using Arial Unicode MS Font that allows Asian language fonts. Please find the PDF attached. Could someone guide me how to overcome this problem. Tell me where this conversion should actually happen,should this happen in while i generate the XML or while i convert this into PDF. Please find the PDF and the XML Generated Attached. Please do guide me as i am totally stuck and unable to proceed as i am running out of options. Thanks, Rakesh Kumar S **************** CAUTION - Disclaimer ***************** This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS******** End of Disclaimer ********INFOSYS*** --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscribe@... For additional commands, e-mail: fop-users-help@... |
|
|
RE: Problem with Asian Language fonts"Rakesh Kumar S" wrote: > > Hi Guys, [snip] > > My problem is that the characters are appearing as encoded text in the PDF also. I am using UTF-8 encoding.I am using Arial Unicode MS Font that allows Asian language fonts. > Please find the PDF attached. > Could someone guide me how to overcome this problem. > Looking at candidade.xml.txt, I see that you have: 北方话/北方�� I believe that this should be 北方话/北方�� Hmm, the browser or Hotmail has magically replaced the text that I typed with the chinese/japanese/korean/whatever characters, but I simply wanted to say don't use &. Write & followed by #nnnnn. When you write & you are saying that you want the literal symbol "&", and you do not want the & to be treated as a special symbol, i.e., part of a character entity. Therefore you end up with "&" followed by "#21271" instead of the character that 北 represents. _________________________________________________________________ Making the world a better place one message at a time. http://www.imtalkathon.com/?source=EML_WLH_Talkathon_BetterPlace --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscribe@... For additional commands, e-mail: fop-users-help@... |
|
|
Re: Problem with Asian Language fontsMy XML is being totally scrambled. I meant to write:
Don't use the chararcter entity "& a m p ;", which means that you want a literal ampersand character to appear in the output. That is, instead of "& a m p ; # 2 1 2 7 1 ;", write "& # 2 1 2 7 1 ;" --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscribe@... For additional commands, e-mail: fop-users-help@... |
|
|
RE: Problem with Asian Language fontsThanks a lot John...
it worked fine... Now should i do this conversion every time ... Because XML stores this as & but i need this as & while converting as PDF ________________________________________ From: news [news@...] On Behalf Of John Brown [johnbrown105@...] Sent: Wednesday, July 09, 2008 6:23 PM To: fop-users@... Subject: Re: Problem with Asian Language fonts My XML is being totally scrambled. I meant to write: Don't use the chararcter entity "& a m p ;", which means that you want a literal ampersand character to appear in the output. That is, instead of "& a m p ; # 2 1 2 7 1 ;", write "& # 2 1 2 7 1 ;" --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscribe@... For additional commands, e-mail: fop-users-help@... **************** CAUTION - Disclaimer ***************** This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS******** End of Disclaimer ********INFOSYS*** --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscribe@... For additional commands, e-mail: fop-users-help@... |
|
|
Re: Problem with Asian Language fontsRakesh Kumar S wrote:
> Thanks a lot John... > it worked fine... > > Now should i do this conversion every time ... > Because XML stores this as & but i need this as & while converting as PDF XML does not store anything (XML is a meta language and does not have actions on its own). Your problem is either when you store it to the database (you say that you escape the data) or when you retrieve it back (using Castor, as you stated in your original question). At some point, you have a character, say "€" (euro symbol), it gets escaped to , which gets escaped to € (a second escape which is not proper). It may even be escaped one more time, storing it in the database as &#128;. To get out of this mess do the following: 1. Always check your data using a text editor (DO NOT USE A BROWSER TO VIEW XML!) 2. Make sure you do not escape at all anymore (!!!) 3. Before storing it in the database, use XSLT (or a tool) to store the XML as XML with encoding "US-ASCII", this will effectively escape all higher characters (above ASCII 127). 4. When retrieving it from the database, either do nothing (use the XML with the encoding US-ASCII should be just fine to Apache FOP or any other XML capable process), or transform it to XML with encoding UTF-8 for readability. Most (XSLT/tool) processors will remove the entities to their UTF-8 character counterparts, but they are not required to do so! Regardless: do not escape by hand, only use XML tools and set the encoding to something your database can store. That way, you do not have to worry about silly double / triple up or down conversions. HTH, Cheers, -- Abel -- --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscribe@... For additional commands, e-mail: fop-users-help@... |
| Free Forum Powered by Nabble | Forum Help |