PDF generation for UTF-8 environments
Hello! The attached patch solves a problem in UTF-8 environments when creating PDFs. It also requires the attached fop.cfg.xml (goes into src/main/resources/). With that patch applied, PDFs can be generated in an UTF-8 environment, i.e. no longer exceptions while doing so. But the generated PDFs might not contain all characters. This depends on the font being used to generate the PDF. To make this work under all circumstances, one would need a font containing the complete UTF-8 character set. Unfortunately such fonts are not freely available. But for instance the DejaVu font (which is based on the free BitStream Vera font) would be an option, though CJK users would need to use another font. To switch between the different fonts, it is currently required to edit the xhtml2fo.xsl (the patch contains a comment which shows how to switch to a Japanese font, at least for normal text). Maybe using several xsl files, depending on the language settings of the page would be an option to select the correct font? -- Michael Reinsch <mreinsch@mandriva.com> ------------------------------------------------------------------------
On 3/22/06, Michael Reinsch <mreinsch@mandriva.com> wrote:
Hello!
The attached patch solves a problem in UTF-8 environments when creating PDFs. It also requires the attached fop.cfg.xml (goes into src/main/resources/).
With that patch applied, PDFs can be generated in an UTF-8 environment, i.e. no longer exceptions while doing so. But the generated PDFs might not contain all characters. This depends on the font being used to generate the PDF. To make this work under all circumstances, one would need a font containing the complete UTF-8 character set. Unfortunately such fonts are not freely available. But for instance the DejaVu font (which is based on the free BitStream Vera font) would be an option, though CJK users would need to use another font.
To switch between the different fonts, it is currently required to edit the xhtml2fo.xsl (the patch contains a comment which shows how to switch to a Japanese font, at least for normal text).
Maybe using several xsl files, depending on the language settings of the page would be an option to select the correct font?
Thanks, I will take a look tomorrow an reply to your question. Jérémi -- Blog: http://www.jeremi.info LinkedIn: https://www.linkedin.com/profile?viewProfile=&key=1437724 Project Manager XWiki: http://www.xwiki.org skype: jeremi23 -- msn et gtalk : jeremi23@gmail.com
On 3/22/06, Michael Reinsch <mreinsch@mandriva.com> wrote:
Hello!
The attached patch solves a problem in UTF-8 environments when creating PDFs. It also requires the attached fop.cfg.xml (goes into src/main/resources/).
With that patch applied, PDFs can be generated in an UTF-8 environment, i.e. no longer exceptions while doing so. But the generated PDFs might not contain all characters. This depends on the font being used to generate the PDF. To make this work under all circumstances, one would need a font containing the complete UTF-8 character set. Unfortunately such fonts are not freely available. But for instance the DejaVu font (which is based on the free BitStream Vera font) would be an option, though CJK users would need to use another font.
To switch between the different fonts, it is currently required to edit the xhtml2fo.xsl (the patch contains a comment which shows how to switch to a Japanese font, at least for normal text).
Maybe using several xsl files, depending on the language settings of the page would be an option to select the correct font? Hi, I tried, and it seems cool.
Does the "Mincho" font is free? Maybe, we can put it in the font directory, and like you say we can create several xsl files for differents languages. Can you do it and the code for using this files depending on the user language? Can you also write a little text about configuring the pdf export for a special set of characters? Thanks a lot for your contribution, Jérémi -- Blog: http://www.jeremi.info LinkedIn: https://www.linkedin.com/profile?viewProfile=&key=1437724 Project Manager XWiki: http://www.xwiki.org skype: jeremi23 -- msn et gtalk : jeremi23@gmail.com
Hello! On 24.03.2006, 14:47 +0800 jeremi joslin wrote:
The attached patch solves a problem in UTF-8 environments when creating PDFs. It also requires the attached fop.cfg.xml (goes into src/main/resources/).
With that patch applied, PDFs can be generated in an UTF-8 environment, i.e. no longer exceptions while doing so. But the generated PDFs might not contain all characters. This depends on the font being used to generate the PDF. To make this work under all circumstances, one would need a font containing the complete UTF-8 character set. Unfortunately such fonts are not freely available. But for instance the DejaVu font (which is based on the free BitStream Vera font) would be an option, though CJK users would need to use another font.
To switch between the different fonts, it is currently required to edit the xhtml2fo.xsl (the patch contains a comment which shows how to switch to a Japanese font, at least for normal text).
Maybe using several xsl files, depending on the language settings of the page would be an option to select the correct font? Hi, I tried, and it seems cool.
Does the "Mincho" font is free? Maybe, we can put it in the font directory, and like you say we can create several xsl files for differents languages.
There is one kind of Mincho font called sazanami-mincho which is free. And yeah, putting a collection of free fonts into the font directory was my intention, especially because you need to generate an additional file per font for FOP.
Can you do it and the code for using this files depending on the user language?
OK, I'll have a look at that then.
Can you also write a little text about configuring the pdf export for a special set of characters?
Sure... -- Michael Reinsch <mreinsch@mandriva.com> ------------------------------------------------------------------------
Hi, Have you had the time to do it? I would like if it's possible to include it in the beta1 which will be released soon (I think, end of this month). Thanks for your help, Jérémi On 3/24/06, Michael Reinsch <mreinsch@mandriva.com> wrote:
Hello!
On 24.03.2006, 14:47 +0800 jeremi joslin wrote:
The attached patch solves a problem in UTF-8 environments when creating PDFs. It also requires the attached fop.cfg.xml (goes into src/main/resources/).
With that patch applied, PDFs can be generated in an UTF-8 environment, i.e. no longer exceptions while doing so. But the generated PDFs might not contain all characters. This depends on the font being used to generate the PDF. To make this work under all circumstances, one would need a font containing the complete UTF-8 character set. Unfortunately such fonts are not freely available. But for instance the DejaVu font (which is based on the free BitStream Vera font) would be an option, though CJK users would need to use another font.
To switch between the different fonts, it is currently required to edit the xhtml2fo.xsl (the patch contains a comment which shows how to switch to a Japanese font, at least for normal text).
Maybe using several xsl files, depending on the language settings of the page would be an option to select the correct font? Hi, I tried, and it seems cool.
Does the "Mincho" font is free? Maybe, we can put it in the font directory, and like you say we can create several xsl files for differents languages.
There is one kind of Mincho font called sazanami-mincho which is free. And yeah, putting a collection of free fonts into the font directory was my intention, especially because you need to generate an additional file per font for FOP.
Can you do it and the code for using this files depending on the user language?
OK, I'll have a look at that then.
Can you also write a little text about configuring the pdf export for a special set of characters?
Sure...
-- Michael Reinsch <mreinsch@mandriva.com> ------------------------------------------------------------------------
-- You receive this message as a subscriber of the xwiki-dev@objectweb.org mailing list. To unsubscribe: mailto:xwiki-dev-unsubscribe@objectweb.org For general help: mailto:sympa@objectweb.org?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
-- Blog: http://www.jeremi.info LinkedIn: https://www.linkedin.com/profile?viewProfile=&key=1437724 Project Manager XWiki: http://www.xwiki.org skype: jeremi23 -- msn et gtalk : jeremi23@gmail.com
participants (2)
-
jeremi joslin -
Michael Reinsch