nsaswift.blogg.se

Lucida sans unicode html code
Lucida sans unicode html code












String arialuniTff = Path.Combine(Environment.GetFolderPath(), "ARIALUNI.TTF") The second thing is that you want to actually register the font with iTextSharp so that its aware of it. The first one you did already and that's getting a font that supports your characters. When dealing with Unicode characters and iTextSharp there's a couple of things you need to take care of. Return new Font(_baseFont, size, style, color) Public override Font GetFont(string fontname, string encoding, bool embedded, float size, int style, BaseColor color, _baseFont = BaseFont.CreateFont(FontPath, BaseFont.IDENTITY_H, BaseFont.EMBEDDED) Private static readonly string FontPath = Path.Combine(Environment.GetFolderPath(), Public class UnicodeFontFactory : FontFactoryImp

lucida sans unicode html code

Worker.ParseXHtml(writer, document, htmlInput, null, Encoding.UTF8, new UnicodeFontFactory()) Var worker = XMLWorkerHelper.GetInstance() Var writer = PdfWriter.GetInstance(document, pdfOutput) Using (var document = new Document(PageSize.A4, 30, 30, 30, 30)) Void CreatePdf(Stream htmlInput, Stream pdfOutput) Using (var output = new FileStream(outputFilename, FileMode.Create)) void GeneratePdfFromHtml()Ĭonst string outputFilename = string inputFilename = (var input = new FileStream(inputFilename, FileMode.Open))

lucida sans unicode html code

You can also use the new XMLWorkerHelper (from library itextsharp.xmlworker), you need to override the default FontFactory implementation however.














Lucida sans unicode html code