【发布时间】:2014-03-05 22:37:44
【问题描述】:
我正在使用 iTextSharp 使用像 TradGothic 这样的 Privae 字体在 Pdf 中编写文本。
我的文本包含上标也喜欢 - ABCCorp®。但它不会出现在 Pdf 中,它显示为 Normal Text 圆形圆圈和 R 里面。
我的代码是
BaseFont TGothic20CondsdBold = BaseFont.CreateFont(strTGothicBold20Path, BaseFont.CP1252, BaseFont.EMBEDDED);
cb.SetFontAndSize(TGothic20CondsdBold, 15);
cb.SetLeading(12.5f);
cb.MoveText(187, 185);
cb.ShowText("ABCCorp®");
cb.EndText();
我正在使用 PdfStamper 将文本写入现有布局。
//Use a PdfStamper to bind our source file with our output file
using (PdfStamper stamper = new PdfStamper(reader, fs))
{
//In case of conflict we want our new text to be written "on top" of any existing content
//Get the "Over" state for page 1
PdfContentByte cb = stamper.GetOverContent(1);
cb.BeginText();
//Set the font information for heading
}
任何有关工作示例代码的帮助都将得到高度重视。
PS:- 我也尝试过等效的 HTML 和其他代码,但没有任何效果
【问题讨论】:
标签: c# itextsharp