Sunday, January 25, 2015

Flying Saucer API Chinese font problem

I have an HTML page with Chinese text in it . I use Flying Saucer API Version R8 to convert the HTML to PDF. Below are two set of problems I am facing.

1. Need Bold and Italic in text.
2. Line wrap is issue and much of line text is lost due to incorrect line wraps.

Solutions :

The support will come in R9 version which does not exist since 2011 so there is no point in waiting for it.

There are some extension which can solve both of the above problems, but I may not be able to use such extension because of restrictions.

Luckily there are work arounds :
1. Chinese/Japanese text never has Bold or Italic because the strokes are important in characters and bold font and italic fonts will ruin it. So we cannot do anything about it. I am using ArialUni font which does not support bold or italic.

2. For line wrap , added space between every chinese 'comma', 'period' , 'semi colon' characters. It works fine.

No comments: