I have a good solution to showing Persian text to any export (pdf, word, html)
The problem is some exports like pdf can not resolve Persian fonts and you can not pass your text to parameter.
You need just convert your text to Unicode by \u0xxxx format and pass it to your parameter instead of original text.
public String toUnicode(String originalText)
{
String outPutText = new String();
boolean asciiText = false;
for(int i = 0; i < originalText.length(); i++)
if(originalText.substring(i, i + 1).compareTo("0") >= 0 && originalText.substring(i, i + 1).compareTo("9") <= 0)
{
int ii = Character.getNumericValue(originalText.charAt(i)) + 1632;
char ch = (char)ii;
outPutText = outPutText + Character.toString(ch);
} else
{
outPutText = outPutText + originalText.charAt(i);
}
return outPutText != null ? outPutText : "";
}
public String toAnsii(String unicodeText)
{
String outPutText = new String();
String wordTmp = new String();
int iii = 0;
int Len = 0;
int unicodeIndex = 0;
int asciiIndex = 0;
char c = '\0';
int i = 0;
do
if(i < unicodeText.length())
{
c = unicodeText.charAt(i);
if(c == '\\')
{
i++;
c = unicodeText.charAt(i);
switch(c)
{
case 117: // 'u'
outPutText = outPutText + (char)Integer.parseInt(unicodeText.substring(i + 1, i + 5).toString(), 16);
i += 5;
break;
}
} else
{
outPutText = outPutText + c;
i++;
}
} else
{
return outPutText != null ? outPutText : "";
}
while(true);
}
I hope can be resolved your problem, but If you feel your problem is remaing, I can send you a sample project.