I'm using Flying Saucer for converting XHTML to PDF Files. My Problem is that i have some missing Turkish characters in PDF. But what i don't understand, i don't have any Problems in junit tests. I can convert XHTML files to PDF with all Turkish characters without any Problem. But if i do the same on Applicaton deployed on Tomcat, all Turkish characters missing.
I did some debug and found out that '/fonts/arialuni.ttf' is found in both cases. i found some related threads and itext doc and tried all of them.
http://developers.itextpdf.com/question/how-can-i-load-font-web-infresourcesfontsfoobarttf
Flying Saucer font for unicode characters
code for convert and adding font
String path2 = "/fonts/arialuni.ttf";
//FontFactory.register(path2);
ITextRenderer renderer = new ITextRenderer();
// renderer.getFontResolver().addFontDirectory(path2,true);
renderer.getFontResolver().addFont(path2, BaseFont.IDENTITY_H,BaseFont.EMBEDDED);
renderer.setDocumentFromString(docElem.html());
renderer.layout();
renderer.createPDF(os);
renderer.finishPDF();
baoOut.flush();
and also applied following for CSS. But still same result.
@font-face {
src: url('arialuni.ttf'); <!--src: url('/fonts/arialuni.ttf'); -->
-fs-pdf-font-embed: embed;
-fs-pdf-font-encoding: Identity-H;
}
body {
font-family: Arial Unicode MS, Lucida Sans Unicode, Arial, verdana, arial, helvetica, sans-serif;
font-size: 8.8pt;
}
Does anybody know, why arialuni.tff is found but not used on Tomcat ?