标签:http ar color os sp on div bs ef
Document doc =
new
Document(
new
iTextSharp.text.Rectangle(564, 351));
PdfWriter writer= PdfWriter.GetInstance(doc,
new
FileStream(HttpContext.Current.Server.MapPath(
"1.pdf"
), FileMode.Create));
doc.Open();
PdfContentByte cb = writer.DirectContent;
cb.BeginText();
BaseFont bfont = BaseFont.CreateFont(
@"c:\windows\fonts\SIMHEI.TTF"
, BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
//设定字体:黑体
cb.SetFontAndSize(bfont, 18);
//设定字号
cb.SetCharacterSpacing(1);
//设定字间距
cb.SetRGBColorFill(66, 00, 00);
//设定文本颜色
cb.ShowTextAligned(PdfContentByte.ALIGN_LEFT,
"在位置100,70处开始显示文本"
, 100, 70,0);
cb.EndText();
doc.Close();
标签:http ar color os sp on div bs ef
原文地址:http://www.cnblogs.com/wangcq/p/4108459.html