当我尝试从 HTML 生成 PDF 时,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();
}
Run Code Online (Sandbox Code Playgroud)
如何在 PDF 上打印所有土耳其语字符?
itextsharp ×1