hi
i am new to IText and i liked it so much its a very powerful toll that given my
exactly what i wanted for my application
I have a little requirement, now I am bulding an application that would create
report in PDF format the report consists of some blocs of Arabic words that
are acquired from parsing HTML files and as far as I know that to print Arabic
letters I need to provide a font for the text but I am using Element to pars the
blocs, so is their any way that I can assign font to the Element
Here is my code
Document document = new Document();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
PdfWriter.getInstance(document, baos);
document.open();
String filepath = reportoperations.getFileContent(DOCID ,"crmadmin" ,
"crmadmin");// special way to read the file
InputStream input = new FileInputStream (filepath);
document.add(new Paragraph("HelloWorld"));
BaseFont bf =
BaseFont.createFont("c:/windows/fonts/arial.ttf",
BaseFont.IDENTITY_H, true);
Font font = new Font(bf, 14);
MultiColumnText mct = new MultiColumnText();
mct.addSimpleColumn(36, PageSize.A4.width() - 36);
mct.setRunDirection(PdfWriter.RUN_DIRECTION_LTR);
ArrayList p = HTMLWorker.parseToList(new InputStreamReader(input), null );
// read the text by parsing the HTML
for (int k = 0; k < p.size(); ++k)
mct.addElement((Element)p.get(k)); // add the text to Element the Arabic text
doesn't appear here I want to add font to the //Element so that the Arabic
litter is readable
document.add(mct);
document.close();
} catch (DocumentException e) {
e.printStackTrace();
}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/