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();