allcolor / YaHP-Converter

YaHP is a Java library that allows you to convert an HTML document into a PDF document.
GNU Lesser General Public License v2.1
56 stars 23 forks source link

error accents #23

Open Jorgealb01 opened 10 years ago

Jorgealb01 commented 10 years ago

I have problems with the accents in the spanish pages , for example the conversion is "bsqueda" instead "búsqueda"

allcolor commented 10 years ago

I have already answered that you need to embed the fonts for that to work...

For that you must set the property HtmlToPdfTransformer.FOP_TTF_FONT_PATH to point to a directory containing truetype font containing the desired characters (so it's a path to a directory containing ttf font file, not to the ttf file directly) and in your html you must reference the correct font to use via the css font-family directive for example, if you use Arial Unicode from Microsoft (which contains all unicode characters) you reference it with

búsqueda

You have to do the same for any desired font, you must use the correct font name in your html and have the font in ttf format in the directory pointed to by the property FOP_TTF_FONT_PATH.

Regards, Quentin

2014-03-10 8:45 GMT+01:00 Jorgealb01 notifications@github.com:

I have problems with the accents in the spanish pages , for example the conversion is "bsqueda" instead "búsqueda"

— Reply to this email directly or view it on GitHubhttps://github.com/allcolor/YaHP-Converter/issues/23 .

All those moments will be lost in time, like tears in rain. (Roy Batty/Rutger Hauer)