当我尝试从HTML生成PDF时,一些土耳其字符如ĞÜŞİÖÇ
ğüşıöç
在PDF中缺失,我看到一个空格代替这些字符,但我想打印该字符。itextSharp - html to pdf一些土耳其字符丢失
我的代码是:
public virtual void print pdf(string html, int id)
{
String htmlText = html.ToString();
Document document = new Document();
string filePath = HostingEnvironment.MapPath("~/Content/Pdf/");
PdfWriter.GetInstance(document, new FileStream(filePath + "\\pdf-"+id+".pdf", FileMode.Create));
document.Open();
iTextSharp.text.html.simpleparser.HTMLWorker hw =
new iTextSharp.text.html.simpleparser.HTMLWorker(document);
hw.Parse(new StringReader(htmlText));
document.Close();
}
如何打印PDF所有土耳其字符?
[iTextSharp的5抛光字符]的可能重复(http://stackoverflow.com/questions/4902033/itextsharp-5-polish-character) –
可能重复[itextSharp-htmlString to pdf Unicode are missing](http://stackoverflow.com/questions/21423993/itextsharp-htmlstring-to-pdf-unicode-are-missing) –