Hello,
I tried to generate an PDF file from HTML, but after parsing the list of
characters : "ă, ş and ţ" aren't displayed.
I tried to encode the html text to CP1250 but just "î anb â" are displayed.
This is the source code that i am using:
iTextSharp.text.Document idocument = new
iTextSharp.text.Document(iTextSharp.text.PageSize.A4, 32, 32, 50, 50);
using (MemoryStream m = new MemoryStream())
{
iTextSharp.text.pdf.PdfWriter.GetInstance(idocument, m);
idocument.Open();
using (TextReader sReader = new StreamReader(new
MemoryStream(System.Text.Encoding.GetEncoding(1250).GetBytes(html)),
Encoding..GetEncoding(1250)))
{
iTextSharp.text.html.simpleparser.HTMLWorker worker = new
iTextSharp.text.html.simpleparser.HTMLWorker(idocument);
worker.StartDocument();
worker.Parse(sReader);
worker.EndDocument();
}
idocument.Close();
doc = m.ToArray();
}
return doc;
Thanks for help!
Ionel Vele
------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php