PDF generation for UTF-8 environments

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

PDF generation for UTF-8 environments

Michael Reinsch-2
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 <[hidden email]>
------------------------------------------------------------------------


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

utf8.patch (7K) Download Attachment
fop.cfg.xml (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: PDF generation for UTF-8 environments

jeremi joslin
On 3/22/06, Michael Reinsch <[hidden email]> 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 : [hidden email]


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: PDF generation for UTF-8 environments

jeremi joslin
In reply to this post by Michael Reinsch-2
On 3/22/06, Michael Reinsch <[hidden email]> 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 : [hidden email]


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: PDF generation for UTF-8 environments

Michael Reinsch-2
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 <[hidden email]>
------------------------------------------------------------------------




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: PDF generation for UTF-8 environments

jeremi joslin
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 <[hidden email]> 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 <[hidden email]>
> ------------------------------------------------------------------------
>
>
>
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?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 : [hidden email]


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws