iTextSharp 5 polnischen Charakter

Problem habe ich mit polnischen Zeichen unter Verwendung itextSharp. Ich möchte zum erstellen von pdf aus html. Alles funktioniert gut, aber die polnischen Zeichen fehlen. Ich benutze die Funktion lower:

    private void createPDF(string html)
    {
        //MemoryStream msOutput = new MemoryStream();
        TextReader reader = new StringReader(html);//step 1: creation of a document-object
        Document document = new Document(PageSize.A4, 30, 30, 30, 30);

        //step 2:
        //we create a writer that listens to the document
        //and directs a XML-stream to a file
        PdfWriter writer = PdfWriter.GetInstance(document, new FileStream("Test.pdf", FileMode.Create));

        //step 3: we create a worker parse the document
        HTMLWorker worker = new HTMLWorker(document);

        //step 4: we open document and start the worker on the document
        document.Open();
        worker.StartDocument();

        //step 5: parse the html into the document
        worker.Parse(reader);

        //step 6: close the document and the worker
        worker.EndDocument();
        worker.Close();
        document.Close();
    }

Und Versuchen Sie es verwenden:

createPDF("ĄąćęĘłŁŃńóÓŚśŹźŻż");

Ich versuche set:

BaseFont bf = BaseFont.CreateFont(BaseFont.TIMES_ROMAN, Codierung.UTF8.HeaderName, BaseFont.EMBEDDED);

        writer.DirectContent.SetFontAndSize(bf, 16);

Aber es doesnt Arbeit

Haben Sie eine Idee????

Hinsichtlich

InformationsquelleAutor dzajdol | 2011-02-04

Schreibe einen Kommentar