Danilo Cubrovic
unread,May 24, 2011, 8:28:45 AM5/24/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Flying Saucer Users
I'm new user of this great library.Pretty impressed with what I've
seen so far.
I'm having only one , but dealbreaking, problem.
This is issue with generating pdf with some foreign latin characters
in it.
I'm pretty sure I'm doing something wrong but dont know what.
When I generate pdf with code like this
ITextRenderer renderer = new ITextRenderer();
ITextFontResolver fontResolver = renderer.getFontResolver();
fontResolver.addFont("/fs/build/ekspert/
lsansuni.ttf",BaseFont.IDENTITY_H, true);
renderer.setDocumentFromString(txt);
renderer.layout();
renderer.createPDF(os);
it goes without errors but my characters still missing
When I open this pdf file and add paragraph with same text string and
font it goes well ?!
BaseFont baseFont = BaseFont.createFont("/fs/build/ekspert/
lsansuni.ttf", BaseFont.IDENTITY_H, true);
Font font = new Font(baseFont, 12);
Document pdfDocument = new Document();
PdfWriter.getInstance(pdfDocument, new FileOutputStream(RESULT2));
pdfDocument.open();
Paragraph p1 = new Paragraph(new Chunk(txt, font));
pdfDocument.add(p1);
pdfDocument.close();
But this method 2 is only good for trivial one paragraph test, cant
generate pdf from my big html files that way :(
I have tryed some other arguments in addFont method in first example.
Didnt help.
Does anybody have idea what I'm doing wrong?
(BTW using it, now, on Kubunutu Linux distro. Will be moved to FreeBsd
server later.)
Thanks in advance.